use of org.xmpp.packet.Message in project Openfire by igniterealtime.
the class OfflineMessageStoreTest method shouldNotStoreErrorMessages.
@Test
public void shouldNotStoreErrorMessages() {
// XEP-0160: "error" message types SHOULD NOT be stored offline,
Message message = new Message();
message.setType(Message.Type.error);
assertFalse(OfflineMessageStore.shouldStoreMessage(message));
}
use of org.xmpp.packet.Message in project Openfire by igniterealtime.
the class OfflineMessageStoreTest method shouldStoreNonEmptyChatMessages.
@Test
public void shouldStoreNonEmptyChatMessages() {
// XEP-0160: "chat" message types SHOULD be stored offline unless they only contain chat state notifications
Message message = new Message();
message.setType(Message.Type.chat);
message.setBody(" ");
assertTrue(OfflineMessageStore.shouldStoreMessage(message));
}
use of org.xmpp.packet.Message in project Openfire by igniterealtime.
the class OfflineMessageStoreTest method shouldNotStoreGroupChatMessages.
@Test
public void shouldNotStoreGroupChatMessages() {
// XEP-0160: "groupchat" message types SHOULD NOT be stored offline
Message message = new Message();
message.setType(Message.Type.groupchat);
assertFalse(OfflineMessageStore.shouldStoreMessage(message));
}
use of org.xmpp.packet.Message in project Openfire by igniterealtime.
the class OfflineMessageStoreTest method shouldNotStoreEmptyChatMessagesWithOnlyChatStatesAndThread.
@Test
public void shouldNotStoreEmptyChatMessagesWithOnlyChatStatesAndThread() {
Message message = new Message();
message.setType(Message.Type.chat);
message.setThread("1234");
PacketExtension chatState = new PacketExtension("composing", "http://jabber.org/protocol/chatstates");
message.addExtension(chatState);
assertFalse(OfflineMessageStore.shouldStoreMessage(message));
}
use of org.xmpp.packet.Message in project Openfire by igniterealtime.
the class OfflineMessageStoreTest method shouldNotStoreHeadlineMessages.
@Test
public void shouldNotStoreHeadlineMessages() {
// XEP-0160: "headline" message types SHOULD NOT be stored offline
Message message = new Message();
message.setType(Message.Type.headline);
assertFalse(OfflineMessageStore.shouldStoreMessage(message));
}
Aggregations