From 38a9242955704232039272fd8b6011d47622495d Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Thu, 17 Jul 2014 00:03:37 +0200 Subject: brought muc invites back. + couple of bug fixes + refactoring --- .../services/XmppConnectionService.java | 36 +++++++++++++--------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java') diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index abcb1f97..dd4363f4 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 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(); -- cgit v1.2.3