diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/services/XmppConnectionService.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 61a9d2318..27412e1ea 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -70,6 +70,7 @@ import java.util.ListIterator; import java.util.Locale; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import de.duenndns.ssl.MemorizingTrustManager; @@ -189,8 +190,9 @@ public class XmppConnectionService extends Service { }; private FileBackend fileBackend = new FileBackend(this); private MemorizingTrustManager mMemorizingTrustManager; - private NotificationService mNotificationService = new NotificationService( - this); + private NotificationService mNotificationService = new NotificationService(this); + private ShortcutService mShortcutService = new ShortcutService(this); + private AtomicBoolean mInitialAddressbookSyncCompleted = new AtomicBoolean(false); private OnMessagePacketReceived mMessageParser = new MessageParser(this); private OnPresencePacketReceived mPresenceParser = new PresenceParser(this); private IqParser mIqParser = new IqParser(this); @@ -1663,6 +1665,7 @@ public class XmppConnectionService extends Service { } } Log.d(Config.LOGTAG, "finished merging phone contacts"); + mShortcutService.refresh(mInitialAddressbookSyncCompleted.compareAndSet(false, true)); updateAccountUi(); } }); @@ -3788,10 +3791,11 @@ public class XmppConnectionService extends Service { return this.mMessageArchiveService; } - public List<Contact> findContacts(Jid jid) { + public List<Contact> findContacts(Jid jid, String accountJid) { ArrayList<Contact> contacts = new ArrayList<>(); for (Account account : getAccounts()) { - if (!account.isOptionSet(Account.OPTION_DISABLED)) { + if (!account.isOptionSet(Account.OPTION_DISABLED) + && (accountJid == null || accountJid.equals(account.getJid().toBareJid().toString()))) { Contact contact = account.getRoster().getContactFromRoster(jid); if (contact != null) { contacts.add(contact); @@ -4176,6 +4180,10 @@ public class XmppConnectionService extends Service { } } + public ShortcutService getShortcutService() { + return mShortcutService; + } + public interface OnMamPreferencesFetched { void onPreferencesFetched(Element prefs); |