mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-11 11:45:01 -05:00
handle app links for conferences
This commit is contained in:
parent
8eb1640a26
commit
9321ccc775
@ -82,7 +82,8 @@
|
|||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<data android:scheme="https" />
|
<data android:scheme="https" />
|
||||||
<data android:host="conversations.im" />
|
<data android:host="conversations.im" />
|
||||||
<data android:pathPrefix="/i/"/>
|
<data android:pathPrefix="/i/" />
|
||||||
|
<data android:pathPrefix="/j/" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
@ -3124,6 +3124,16 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
|||||||
return contacts;
|
return contacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Conversation findFirstMuc(Jid jid) {
|
||||||
|
for(Conversation conversation : getConversations()) {
|
||||||
|
if (conversation.getJid().toBareJid().equals(jid.toBareJid())
|
||||||
|
&& conversation.getMode() == Conversation.MODE_MULTI) {
|
||||||
|
return conversation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public NotificationService getNotificationService() {
|
public NotificationService getNotificationService() {
|
||||||
return this.mNotificationService;
|
return this.mNotificationService;
|
||||||
}
|
}
|
||||||
|
@ -846,7 +846,16 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
|
|||||||
|
|
||||||
private boolean handleJid(Invite invite) {
|
private boolean handleJid(Invite invite) {
|
||||||
List<Contact> contacts = xmppConnectionService.findContacts(invite.getJid());
|
List<Contact> contacts = xmppConnectionService.findContacts(invite.getJid());
|
||||||
if (contacts.size() == 0) {
|
if (invite.isMuc()) {
|
||||||
|
Conversation muc = xmppConnectionService.findFirstMuc(invite.getJid());
|
||||||
|
if (muc != null) {
|
||||||
|
switchToConversation(muc);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
showJoinConferenceDialog(invite.getJid().toBareJid().toString());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (contacts.size() == 0) {
|
||||||
showCreateContactDialog(invite.getJid().toString(),invite.getFingerprint());
|
showCreateContactDialog(invite.getJid().toString(),invite.getFingerprint());
|
||||||
return false;
|
return false;
|
||||||
} else if (contacts.size() == 1) {
|
} else if (contacts.size() == 1) {
|
||||||
@ -1020,13 +1029,13 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
|
|||||||
|
|
||||||
boolean invite() {
|
boolean invite() {
|
||||||
if (jid != null) {
|
if (jid != null) {
|
||||||
if (muc) {
|
return handleJid(this);
|
||||||
showJoinConferenceDialog(jid);
|
|
||||||
} else {
|
|
||||||
return handleJid(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isMuc() {
|
||||||
|
return muc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ public class XmppUri {
|
|||||||
// sample : https://conversations.im/i/foo/bar.com
|
// sample : https://conversations.im/i/foo/bar.com
|
||||||
jid = segments.get(1) + "@" + segments.get(2);
|
jid = segments.get(1) + "@" + segments.get(2);
|
||||||
}
|
}
|
||||||
|
muc = segments.size() > 1 && "j".equalsIgnoreCase(segments.get(0));
|
||||||
} else if ("xmpp".equalsIgnoreCase(scheme)) {
|
} else if ("xmpp".equalsIgnoreCase(scheme)) {
|
||||||
// sample: xmpp:foo@bar.com
|
// sample: xmpp:foo@bar.com
|
||||||
muc = "join".equalsIgnoreCase(uri.getQuery());
|
muc = "join".equalsIgnoreCase(uri.getQuery());
|
||||||
|
Loading…
Reference in New Issue
Block a user