Commit 5fad8a2d authored by Tijmen de Mes's avatar Tijmen de Mes

Fixed storing 'right' display name in history

parent d1297740
......@@ -317,12 +317,15 @@ class MessageHistory(object, metaclass=Singleton):
if match:
remote_uri = match.group('number')
try:
contact = next(contact for contact in AddressbookManager().get_contacts() if remote_uri in (addr.uri for addr in contact.uris))
except StopIteration:
if direction == 'outgoing':
display_name = message.sender.display_name
else:
display_name = contact.name
try:
contact = next(contact for contact in AddressbookManager().get_contacts() if remote_uri in (addr.uri for addr in contact.uris))
except StopIteration:
display_name = message.sender.display_name
else:
display_name = contact.name
timestamp_native = message.timestamp
timestamp_utc = timestamp_native.replace(tzinfo=timezone.utc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment