mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-14 06:51:08 +01:00
Add XMPPConnection.sendStanza(Stanza)
and deprecate sendPacket().
This commit is contained in:
parent
183af99ffb
commit
ed4fa3390f
58 changed files with 183 additions and 167 deletions
|
|
@ -518,7 +518,7 @@ public class MultiUserChat {
|
|||
// field is in the form "roomName@service/nickname"
|
||||
Presence leavePresence = new Presence(Presence.Type.unavailable);
|
||||
leavePresence.setTo(room + "/" + nickname);
|
||||
connection.sendPacket(leavePresence);
|
||||
connection.sendStanza(leavePresence);
|
||||
// Reset occupant information.
|
||||
occupantsMap.clear();
|
||||
nickname = null;
|
||||
|
|
@ -689,7 +689,7 @@ public class MultiUserChat {
|
|||
// Add the MUCUser packet that includes the invitation to the message
|
||||
message.addExtension(mucUser);
|
||||
|
||||
connection.sendPacket(message);
|
||||
connection.sendStanza(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -892,7 +892,7 @@ public class MultiUserChat {
|
|||
joinPresence.setTo(room + "/" + nickname);
|
||||
|
||||
// Send join packet.
|
||||
connection.sendPacket(joinPresence);
|
||||
connection.sendStanza(joinPresence);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -939,7 +939,7 @@ public class MultiUserChat {
|
|||
form.addField(requestVoiceField);
|
||||
Message message = new Message(room);
|
||||
message.addExtension(form);
|
||||
connection.sendPacket(message);
|
||||
connection.sendStanza(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1575,7 +1575,7 @@ public class MultiUserChat {
|
|||
public void sendMessage(String text) throws XMPPException, NotConnectedException {
|
||||
Message message = createMessage();
|
||||
message.setBody(text);
|
||||
connection.sendPacket(message);
|
||||
connection.sendStanza(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1612,7 +1612,7 @@ public class MultiUserChat {
|
|||
public void sendMessage(Message message) throws XMPPException, NotConnectedException {
|
||||
message.setTo(room);
|
||||
message.setType(Message.Type.groupchat);
|
||||
connection.sendPacket(message);
|
||||
connection.sendStanza(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ public class MultiUserChatManager extends Manager {
|
|||
// Add the MUCUser packet that includes the rejection
|
||||
message.addExtension(mucUser);
|
||||
|
||||
connection().sendPacket(message);
|
||||
connection().sendStanza(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
* Message message = new Message("user@chat.example.com");
|
||||
* message.setBody("Join me for a group chat!");
|
||||
* message.addExtension(new GroupChatInvitation("room@chat.example.com"););
|
||||
* con.sendPacket(message);
|
||||
* con.sendStanza(message);
|
||||
* </pre>
|
||||
*
|
||||
* To listen for group chat invitations, use a StanzaExtensionFilter for the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue