Search in sources :

Example 6 with ConnectionThread

use of com.xabber.android.data.connection.ConnectionThread in project xabber-android by redsolution.

the class RosterManager method getRoster.

@Nullable
private Roster getRoster(String account) {
    final AccountItem accountItem = AccountManager.getInstance().getAccount(account);
    if (accountItem == null) {
        return null;
    }
    final ConnectionThread connectionThread = accountItem.getConnectionThread();
    if (connectionThread == null) {
        return null;
    }
    final AbstractXMPPConnection xmppConnection = connectionThread.getXMPPConnection();
    if (xmppConnection == null) {
        return null;
    }
    return Roster.getInstanceFor(xmppConnection);
}
Also used : AccountItem(com.xabber.android.data.account.AccountItem) ConnectionThread(com.xabber.android.data.connection.ConnectionThread) AbstractXMPPConnection(org.jivesoftware.smack.AbstractXMPPConnection) Nullable(android.support.annotation.Nullable)

Aggregations

ConnectionThread (com.xabber.android.data.connection.ConnectionThread)6 AccountItem (com.xabber.android.data.account.AccountItem)3 AbstractXMPPConnection (org.jivesoftware.smack.AbstractXMPPConnection)3 NetworkException (com.xabber.android.data.NetworkException)2 XMPPConnection (org.jivesoftware.smack.XMPPConnection)2 XMPPException (org.jivesoftware.smack.XMPPException)2 Nullable (android.support.annotation.Nullable)1 AccountManager (com.xabber.android.data.account.AccountManager)1 SmackException (org.jivesoftware.smack.SmackException)1 XMPPError (org.jivesoftware.smack.packet.XMPPError)1 ServiceDiscoveryManager (org.jivesoftware.smackx.disco.ServiceDiscoveryManager)1 MultiUserChat (org.jivesoftware.smackx.muc.MultiUserChat)1 VCard (org.jivesoftware.smackx.vcardtemp.packet.VCard)1