Search in sources :

Example 21 with ChannelUserMapper

use of com.applozic.mobicommons.people.channel.ChannelUserMapper in project Applozic-Android-SDK by AppLozic.

the class ChannelService method addMemberToChannelProcess.

/**
 * @deprecated Use {@link #addMemberToChannelWithResponseProcess(Integer, String)} instead.
 */
@Deprecated
public String addMemberToChannelProcess(Integer channelKey, String userId) {
    if (channelKey == null && TextUtils.isEmpty(userId)) {
        return "";
    }
    ApiResponse apiResponse = channelClientService.addMemberToChannel(channelKey, userId);
    if (apiResponse == null) {
        return null;
    }
    if (apiResponse.isSuccess()) {
        ChannelUserMapper channelUserMapper = new ChannelUserMapper(channelKey, userId);
        channelDatabaseService.addChannelUserMapper(channelUserMapper);
    }
    return apiResponse.getStatus();
}
Also used : ChannelUserMapper(com.applozic.mobicommons.people.channel.ChannelUserMapper) ChannelFeedApiResponse(com.applozic.mobicomkit.feed.ChannelFeedApiResponse) ApiResponse(com.applozic.mobicomkit.feed.ApiResponse)

Example 22 with ChannelUserMapper

use of com.applozic.mobicommons.people.channel.ChannelUserMapper in project Applozic-Android-SDK by AppLozic.

the class ChannelDatabaseService method getChannelUser.

// Cleanup: private
public static ChannelUserMapper getChannelUser(Cursor cursor) {
    ChannelUserMapper channelUserMapper = new ChannelUserMapper();
    channelUserMapper.setUserKey(cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.USERID)));
    channelUserMapper.setKey(cursor.getInt(cursor.getColumnIndex(MobiComDatabaseHelper.CHANNEL_KEY)));
    channelUserMapper.setUnreadCount(cursor.getShort(cursor.getColumnIndex(MobiComDatabaseHelper.UNREAD_COUNT)));
    channelUserMapper.setRole(cursor.getInt(cursor.getColumnIndex(MobiComDatabaseHelper.ROLE)));
    channelUserMapper.setStatus(cursor.getShort(cursor.getColumnIndex(MobiComDatabaseHelper.STATUS)));
    channelUserMapper.setParentKey(cursor.getInt(cursor.getColumnIndex(MobiComDatabaseHelper.PARENT_GROUP_KEY)));
    return channelUserMapper;
}
Also used : ChannelUserMapper(com.applozic.mobicommons.people.channel.ChannelUserMapper)

Aggregations

ChannelUserMapper (com.applozic.mobicommons.people.channel.ChannelUserMapper)22 Channel (com.applozic.mobicommons.people.channel.Channel)7 ChannelUsersFeed (com.applozic.mobicomkit.feed.ChannelUsersFeed)4 Contact (com.applozic.mobicommons.people.contact.Contact)4 Cursor (android.database.Cursor)3 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)3 ApiResponse (com.applozic.mobicomkit.feed.ApiResponse)3 ChannelFeed (com.applozic.mobicomkit.feed.ChannelFeed)3 ChannelFeedApiResponse (com.applozic.mobicomkit.feed.ChannelFeedApiResponse)3 ArrayList (java.util.ArrayList)3 HashSet (java.util.HashSet)3 AdapterView (android.widget.AdapterView)2 ChannelDatabaseService (com.applozic.mobicomkit.channel.database.ChannelDatabaseService)2 SyncChannelFeed (com.applozic.mobicomkit.sync.SyncChannelFeed)2 Collections.disjoint (java.util.Collections.disjoint)2 Test (org.junit.Test)2 Context (android.content.Context)1 Intent (android.content.Intent)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 SpannableString (android.text.SpannableString)1