back to normal invites. fixed #298

iNPUTmice created

Change summary

src/eu/siacs/conversations/generator/MessageGenerator.java | 15 +++++++
1 file changed, 14 insertions(+), 1 deletion(-)

Detailed changes

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;
+	}
 }