From e3ebccc76213beba3bfe692d42533ae99726278c Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Mon, 21 Jul 2014 19:55:00 +0200 Subject: [PATCH] back to normal invites. fixed #298 --- .../conversations/generator/MessageGenerator.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/eu/siacs/conversations/generator/MessageGenerator.java b/src/eu/siacs/conversations/generator/MessageGenerator.java index 3195c953a..4885177ca 100644 --- a/src/eu/siacs/conversations/generator/MessageGenerator.java +++ b/src/eu/siacs/conversations/generator/MessageGenerator.java @@ -129,7 +129,7 @@ public class MessageGenerator { return packet; } - public MessagePacket invite(Conversation conversation, String contact) { + public MessagePacket directInvite(Conversation conversation, String contact) { MessagePacket packet = new MessagePacket(); packet.setType(MessagePacket.TYPE_NORMAL); packet.setTo(contact); @@ -138,4 +138,17 @@ public class MessageGenerator { x.setAttribute("jid", conversation.getContactJid().split("/")[0]); return packet; } + + public MessagePacket invite(Conversation conversation, String contact) { + 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); + x.addChild(invite); + packet.addChild(x); + return packet; + } }