Search in sources :

Example 1 with StubConversation

use of eu.siacs.conversations.entities.StubConversation in project Conversations by siacs.

the class MessageSearchTask method findOrGenerateStub.

private Conversational findOrGenerateStub(String conversationUuid, String accountUuid, String contactJid, int mode) throws Exception {
    Conversation conversation = xmppConnectionService.findConversationByUuid(conversationUuid);
    if (conversation != null) {
        return conversation;
    }
    Account account = xmppConnectionService.findAccountByUuid(accountUuid);
    Jid jid = Jid.of(contactJid);
    if (account != null && jid != null) {
        return new StubConversation(account, conversationUuid, jid.asBareJid(), mode);
    }
    throw new Exception("Unable to generate stub for " + contactJid);
}
Also used : Account(eu.siacs.conversations.entities.Account) Jid(eu.siacs.conversations.xmpp.Jid) StubConversation(eu.siacs.conversations.entities.StubConversation) StubConversation(eu.siacs.conversations.entities.StubConversation) Conversation(eu.siacs.conversations.entities.Conversation)

Aggregations

Account (eu.siacs.conversations.entities.Account)1 Conversation (eu.siacs.conversations.entities.Conversation)1 StubConversation (eu.siacs.conversations.entities.StubConversation)1 Jid (eu.siacs.conversations.xmpp.Jid)1