Search in sources :

Example 1 with ChatSessionManager

use of org.awesomeapp.messenger.model.ChatSessionManager in project Zom-Android by zom.

the class LoopbackConnection method getChatSessionManager.

@Override
public ChatSessionManager getChatSessionManager() {
    return new ChatSessionManager() {

        @Override
        public void sendMessageAsync(ChatSession session, Message message) {
            // Echo
            Message rec = new Message(message.getBody());
            rec.setFrom(message.getTo());
            rec.setDateTime(new Date());
            session.onReceiveMessage(rec, true);
        }

        @Override
        public boolean resourceSupportsOmemo(Jid jid) {
            return false;
        }
    };
}
Also used : Message(org.awesomeapp.messenger.model.Message) Jid(org.jxmpp.jid.Jid) ChatSessionManager(org.awesomeapp.messenger.model.ChatSessionManager) ChatSession(org.awesomeapp.messenger.model.ChatSession) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 ChatSession (org.awesomeapp.messenger.model.ChatSession)1 ChatSessionManager (org.awesomeapp.messenger.model.ChatSessionManager)1 Message (org.awesomeapp.messenger.model.Message)1 Jid (org.jxmpp.jid.Jid)1