aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services/XmppConnectionService.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-07-17 00:03:37 +0200
committeriNPUTmice <daniel@gultsch.de>2014-07-17 00:03:37 +0200
commit38a9242955704232039272fd8b6011d47622495d (patch)
tree16665564834041b3c1218531d548449e64285f8d /src/eu/siacs/conversations/services/XmppConnectionService.java
parent670dead69502884d178ab60ec10e8e0e7b7a7915 (diff)
brought muc invites back. + couple of bug fixes + refactoring
Diffstat (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index abcb1f975..dd4363f44 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1189,21 +1189,18 @@ public class XmppConnectionService extends Service {
}).start();
}
- public void inviteToConference(Conversation conversation,
- List<Contact> contacts) {
- for (Contact contact : contacts) {
- MessagePacket packet = new MessagePacket();
- packet.setTo(conversation.getContactJid().split("/")[0]);
- packet.setFrom(conversation.getAccount().getFullJid());
- Element x = new Element("x");
- x.setAttribute("xmlns", "http://jabber.org/protocol/muc#user");
- Element invite = new Element("invite");
- invite.setAttribute("to", contact.getJid());
- x.addChild(invite);
- packet.addChild(x);
- Log.d(LOGTAG, packet.toString());
- sendMessagePacket(conversation.getAccount(),packet);
- }
+ public void inviteToConference(Conversation conversation, String contactJid) {
+ Account account = conversation.getAccount();
+ MessagePacket packet = new MessagePacket();
+ packet.setTo(conversation.getContactJid().split("/")[0]);
+ packet.setFrom(account.getFullJid());
+ Element x = new Element("x");
+ x.setAttribute("xmlns", "http://jabber.org/protocol/muc#user");
+ Element invite = new Element("invite");
+ invite.setAttribute("to", contactJid);
+ x.addChild(invite);
+ packet.addChild(x);
+ sendMessagePacket(account,packet);
}
@@ -1273,6 +1270,15 @@ public class XmppConnectionService extends Service {
}
return null;
}
+
+ public Conversation findConversationByUuid(String uuid) {
+ for (Conversation conversation : getConversations()) {
+ if (conversation.getUuid().equals(uuid)) {
+ return conversation;
+ }
+ }
+ return null;
+ }
public void markRead(Conversation conversation) {
conversation.markRead();