Cache contact info a short while

This commit is contained in:
M66B
2019-01-25 13:13:58 +00:00
parent 9f49191734
commit d1624fa800
3 changed files with 54 additions and 13 deletions

View File

@@ -489,7 +489,9 @@ public class ServiceSynchronize extends LifecycleService {
// Get contact info
Map<TupleMessageEx, ContactInfo> messageContact = new HashMap<>();
for (TupleMessageEx message : messages) {
ContactInfo info = ContactInfo.get(this, message.from);
ContactInfo info = ContactInfo.get(this, message.from, true);
if (info == null)
info = ContactInfo.get(this, message.from, false);
if (info == null)
info = new ContactInfo(MessageHelper.formatAddressesShort(message.from));
messageContact.put(message, info);