diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-06-29 22:34:45 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-06-29 22:34:45 +0200 |
commit | 70477c9fc9c6c6df45d2b921d920ec4070535bb4 (patch) | |
tree | 9e53c29f86894cb46a7e79c523b26f839192153b /src/main/java/de/pixart/messenger/services/XmppConnectionService.java | |
parent | dda1f862f0d96571e1353e4deefe10bb57a7d269 (diff) |
linkify subject + open xmpp directly w/o going through start conv activity
Diffstat (limited to 'src/main/java/de/pixart/messenger/services/XmppConnectionService.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 14e27cf47..b6a28ac3c 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -85,6 +85,7 @@ import de.pixart.messenger.entities.Blockable; import de.pixart.messenger.entities.Bookmark; import de.pixart.messenger.entities.Contact; import de.pixart.messenger.entities.Conversation; +import de.pixart.messenger.entities.Conversational; import de.pixart.messenger.entities.DownloadableFile; import de.pixart.messenger.entities.Message; import de.pixart.messenger.entities.MucOptions; @@ -3616,6 +3617,16 @@ public class XmppConnectionService extends Service { return null; } + public Conversation findUniqueConversationByJid(XmppUri xmppUri) { + List<Conversation> findings = new ArrayList<>(); + for (Conversation c : getConversations()) { + if (c.getJid().asBareJid().equals(xmppUri.getJid()) && ((c.getMode() == Conversational.MODE_MULTI) == xmppUri.isAction(XmppUri.ACTION_JOIN))) { + findings.add(c); + } + } + return findings.size() == 1 ? findings.get(0) : null; + } + public boolean markRead(final Conversation conversation, boolean dismiss) { return markRead(conversation, null, dismiss).size() > 0; } |