1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 22:32:06 +01:00

Use createMessage() where possible in MultiUserChat

This commit is contained in:
Florian Schmaus 2014-12-30 12:13:12 +01:00
parent cba681a967
commit e6593cb200

View file

@ -1551,7 +1551,7 @@ public class MultiUserChat {
* @throws NotConnectedException * @throws NotConnectedException
*/ */
public void sendMessage(String text) throws XMPPException, NotConnectedException { public void sendMessage(String text) throws XMPPException, NotConnectedException {
Message message = new Message(room, Message.Type.groupchat); Message message = createMessage();
message.setBody(text); message.setBody(text);
connection.sendPacket(message); connection.sendPacket(message);
} }
@ -1682,7 +1682,7 @@ public class MultiUserChat {
* @throws NotConnectedException * @throws NotConnectedException
*/ */
public void changeSubject(final String subject) throws NoResponseException, XMPPErrorException, NotConnectedException { public void changeSubject(final String subject) throws NoResponseException, XMPPErrorException, NotConnectedException {
Message message = new Message(room, Message.Type.groupchat); Message message = createMessage();
message.setSubject(subject); message.setSubject(subject);
// Wait for an error or confirmation message back from the server. // Wait for an error or confirmation message back from the server.
PacketFilter responseFilter = new AndFilter(fromRoomGroupchatFilter, new PacketFilter() { PacketFilter responseFilter = new AndFilter(fromRoomGroupchatFilter, new PacketFilter() {