def test_encode_decode_nonlatin_alphabet_stream_name(self) -> None: realm = get_realm('zulip') stream_name = 'Тестовы some ascii letters' stream = ensure_stream(realm, stream_name) email_address = encode_email_address(stream) msg_string = get_email_gateway_message_string_from_address( email_address) assert msg_string is not None parts = msg_string.split('+') # Stream name should be completely stripped to '', so msg_string # should only have the email_token in it. self.assertEqual(len(parts), 1) # Correctly decode the resulting address that doesn't have the stream name: tup = decode_email_address(email_address) assert tup is not None token, show_sender = tup self.assertFalse(show_sender) self.assertEqual(token, stream.email_token) asciiable_stream_name = "ąężć" stream = ensure_stream(realm, asciiable_stream_name) email_address = encode_email_address(stream) self.assertTrue(email_address.startswith("aezc+"))
def get_missed_message_token_from_address(address): msg_string = get_email_gateway_message_string_from_address(address) if not msg_string.startswith('mm') and len(msg_string) != 34: raise ZulipEmailForwardError('Could not parse missed message address') # strip off the 'mm' before returning the redis key return msg_string[2:]
def get_missed_message_token_from_address(address): msg_string = get_email_gateway_message_string_from_address(address) if not msg_string.startswith('mm') and len(msg_string) != 34: raise ZulipEmailForwardError('Could not parse missed message address') # strip off the 'mm' before returning the redis key return msg_string[2:]
def get_missed_message_token_from_address(address: str) -> str: msg_string = get_email_gateway_message_string_from_address(address) if msg_string is None: raise ZulipEmailForwardError('Address not recognized by gateway.') if not is_mm_32_format(msg_string): raise ZulipEmailForwardError('Could not parse missed message address') # strip off the 'mm' before returning the redis key return msg_string[2:]
def get_missed_message_token_from_address(address: str) -> str: msg_string = get_email_gateway_message_string_from_address(address) if msg_string is None: raise ZulipEmailForwardError('Address not recognized by gateway.') if not is_mm_32_format(msg_string): raise ZulipEmailForwardError('Could not parse missed message address') # strip off the 'mm' before returning the redis key return msg_string[2:]
def get_missed_message_token_from_address(address): # type: (text_type) -> text_type msg_string = get_email_gateway_message_string_from_address(address) if msg_string is None: raise ZulipEmailForwardError("Address not recognized by gateway.") if not is_mm_32_format(msg_string): raise ZulipEmailForwardError("Could not parse missed message address") # strip off the 'mm' before returning the redis key return msg_string[2:]
def is_missed_message_address(address): # type: (text_type) -> bool msg_string = get_email_gateway_message_string_from_address(address) return msg_string.startswith('mm') and len(msg_string) == 34
def is_missed_message_address(address): # type: (Text) -> bool msg_string = get_email_gateway_message_string_from_address(address) return is_mm_32_format(msg_string)
def is_missed_message_address(address: str) -> bool: msg_string = get_email_gateway_message_string_from_address(address) return is_mm_32_format(msg_string)
def is_missed_message_address(address): # type: (text_type) -> bool msg_string = get_email_gateway_message_string_from_address(address) return msg_string.startswith('mm') and len(msg_string) == 34
def is_missed_message_address(address: str) -> bool: msg_string = get_email_gateway_message_string_from_address(address) return is_mm_32_format(msg_string)
def is_missed_message_address(address): # type: (Text) -> bool msg_string = get_email_gateway_message_string_from_address(address) return is_mm_32_format(msg_string)