Search in sources :

Example 1 with TagListResult

use of com.fanap.podchat.chat.tag.result_model.TagListResult in project pod-chat-android-sdk by FanapSoft.

the class ChatCore method getTagList.

/**
 * get user tags
 */
public String getTagList(GetTagListRequest request) {
    String uniqueId = generateUniqueId();
    if (cache) {
        messageDatabaseHelper.getTagVos().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).filter(tags -> tags != null && tags.size() > 0).subscribe(tags -> {
            ChatResponse<TagListResult> response = new ChatResponse<>();
            response.setResult(new TagListResult(tags));
            response.setUniqueId(uniqueId);
            response.setCache(true);
            listenerManager.callOnTagList(null, response);
        });
    }
    if (chatReady) {
        String message = TagManager.createTagListRequest(request, uniqueId);
        sendAsyncMessage(message, AsyncAckType.Constants.WITHOUT_ACK, "GET_TAG_LIST");
    } else {
        onChatNotReady(uniqueId);
    }
    return uniqueId;
}
Also used : ResultNewMessage(com.fanap.podchat.model.ResultNewMessage) MessageManager(com.fanap.podchat.chat.messge.MessageManager) RequestGetUserRoles(com.fanap.podchat.requestobject.RequestGetUserRoles) RetrofitHelperPlatformHost(com.fanap.podchat.networking.retrofithelper.RetrofitHelperPlatformHost) PhoneContactDbHelper(com.fanap.podchat.persistance.PhoneContactDbHelper) ChatConstant(com.fanap.podchat.util.ChatConstant) GsonBuilder(com.google.gson.GsonBuilder) MapApi(com.fanap.podchat.networking.api.MapApi) JSONException(org.json.JSONException) ResultClearHistory(com.fanap.podchat.model.ResultClearHistory) Async(com.fanap.podasync.Async) Handler(android.os.Handler) MediaStore(android.provider.MediaStore) Map(java.util.Map) OPEN(com.fanap.podchat.util.ChatStateType.ChatSateConstant.OPEN) Schedulers(rx.schedulers.Schedulers) NetworkStateListener(com.fanap.podchat.util.NetworkUtils.NetworkStateListener) FileMetaDataContent(com.fanap.podchat.model.FileMetaDataContent) CONNECTING(com.fanap.podchat.util.ChatStateType.ChatSateConstant.CONNECTING) EditTagRequest(com.fanap.podchat.chat.tag.request_model.EditTagRequest) Log(android.util.Log) MediaType(okhttp3.MediaType) ConnectivityManager(android.net.ConnectivityManager) RequestGetImage(com.fanap.podchat.requestobject.RequestGetImage) Device(com.fanap.podasync.model.Device) IntentFilter(android.content.IntentFilter) ChatMessage(com.fanap.podchat.mainmodel.ChatMessage) ResultCurrentUserRoles(com.fanap.podchat.chat.user.user_roles.model.ResultCurrentUserRoles) RequestAddContact(com.fanap.podchat.requestobject.RequestAddContact) HashTagManager(com.fanap.podchat.chat.hashtag.HashTagManager) RestrictTo(android.support.annotation.RestrictTo) MetaDataFile(com.fanap.podchat.model.MetaDataFile) GetAssistantRequest(com.fanap.podchat.chat.assistant.request_model.GetAssistantRequest) MapRout(com.fanap.podchat.mainmodel.MapRout) RequestReplyMessage(com.fanap.podchat.requestobject.RequestReplyMessage) Sentry(io.sentry.core.Sentry) RequestLocationMessage(com.fanap.podchat.requestobject.RequestLocationMessage) TimeoutConfig(com.fanap.podchat.networking.retrofithelper.TimeoutConfig) DeviceResult(com.fanap.podasync.model.DeviceResult) NonNull(android.support.annotation.NonNull) ResultBlockList(com.fanap.podchat.model.ResultBlockList) JsonParser(com.google.gson.JsonParser) ResultAddParticipant(com.fanap.podchat.model.ResultAddParticipant) RegisterAssistantRequest(com.fanap.podchat.chat.assistant.request_model.RegisterAssistantRequest) ChatResponse(com.fanap.podchat.model.ChatResponse) ResultParticipant(com.fanap.podchat.model.ResultParticipant) NosqlListMessageCriteriaVO(com.fanap.podchat.mainmodel.NosqlListMessageCriteriaVO) ResultRemoveContact(com.fanap.podchat.model.ResultRemoveContact) RequestUploadFile(com.fanap.podchat.requestobject.RequestUploadFile) User(io.sentry.core.protocol.User) BuildConfig(com.fanap.podchat.BuildConfig) Admin(com.fanap.podchat.model.Admin) ResultAddContact(com.fanap.podchat.model.ResultAddContact) UserRoles(com.fanap.podchat.chat.user.user_roles.UserRoles) SentryException(io.sentry.core.protocol.SentryException) UpdateContact(com.fanap.podchat.mainmodel.UpdateContact) IOException(java.io.IOException) MemoryDataSource(com.fanap.podchat.repository.MemoryDataSource) CreateTagRequest(com.fanap.podchat.chat.tag.request_model.CreateTagRequest) RequestGetUnreadMessagesCount(com.fanap.podchat.chat.messge.RequestGetUnreadMessagesCount) RequestUpdateProfile(com.fanap.podchat.chat.user.profile.RequestUpdateProfile) TagResult(com.fanap.podchat.chat.tag.result_model.TagResult) UploadingQueueCache(com.fanap.podchat.cachemodel.queue.UploadingQueueCache) ResultMapReverse(com.fanap.podchat.model.ResultMapReverse) RequestCreateThread(com.fanap.podchat.requestobject.RequestCreateThread) OnWorkDone(com.fanap.podchat.util.OnWorkDone) JsonObject(com.google.gson.JsonObject) ResultDownloadFile(com.fanap.podchat.chat.file_manager.download_file.model.ResultDownloadFile) ResultIsNameAvailable(com.fanap.podchat.chat.thread.public_thread.ResultIsNameAvailable) RequestForwardMessage(com.fanap.podchat.requestobject.RequestForwardMessage) Date(java.util.Date) RequestSetAuditor(com.fanap.podchat.requestobject.RequestSetAuditor) ResultFile(com.fanap.podchat.model.ResultFile) NetworkStateReceiver(com.fanap.podchat.util.NetworkUtils.NetworkStateReceiver) JSONObject(org.json.JSONObject) ContactsContract(android.provider.ContactsContract) TagListResult(com.fanap.podchat.chat.tag.result_model.TagListResult) RequestGetContact(com.fanap.podchat.requestobject.RequestGetContact) Gson(com.google.gson.Gson) RequestGetPodSpaceFile(com.fanap.podchat.requestobject.RequestGetPodSpaceFile) SetRuleVO(com.fanap.podchat.localmodel.SetRuleVO) OutPutHistory(com.fanap.podchat.model.OutPutHistory) ContactApi(com.fanap.podchat.networking.api.ContactApi) RequestMapReverse(com.fanap.podchat.requestobject.RequestMapReverse) FilePick(com.fanap.podchat.util.FilePick) RequestGetFile(com.fanap.podchat.requestobject.RequestGetFile) Participant(com.fanap.podchat.mainmodel.Participant) RequestCreateThreadWithFile(com.fanap.podchat.requestobject.RequestCreateThreadWithFile) CacheUserRoles(com.fanap.podchat.chat.user.user_roles.model.CacheUserRoles) ResultPinThread(com.fanap.podchat.chat.pin.pin_thread.model.ResultPinThread) AsyncTask(android.os.AsyncTask) Error(com.fanap.podchat.model.Error) RequestUpdateContact(com.fanap.podchat.requestobject.RequestUpdateContact) ThreadVo(com.fanap.podchat.cachemodel.ThreadVo) RequestSpam(com.fanap.podchat.requestobject.RequestSpam) ChangeThreadTypeRequest(com.fanap.podchat.chat.thread.request.ChangeThreadTypeRequest) UUID(java.util.UUID) ChatMessageContent(com.fanap.podchat.mainmodel.ChatMessageContent) Objects(java.util.Objects) CloseThreadResult(com.fanap.podchat.chat.thread.respone.CloseThreadResult) R(com.fanap.podchat.R) RequestCheckIsNameAvailable(com.fanap.podchat.chat.thread.public_thread.RequestCheckIsNameAvailable) ErrorOutPut(com.fanap.podchat.model.ErrorOutPut) GetBlockedAssistantsRequest(com.fanap.podchat.chat.assistant.request_model.GetBlockedAssistantsRequest) RequestSignalMsg(com.fanap.podchat.requestobject.RequestSignalMsg) ResultUserInfo(com.fanap.podchat.model.ResultUserInfo) RequestSetAdmin(com.fanap.podchat.requestobject.RequestSetAdmin) Nullable(android.support.annotation.Nullable) OutPutNotSeenDurations(com.fanap.podchat.model.OutPutNotSeenDurations) Call(retrofit2.Call) Subscription(rx.Subscription) Callback(com.fanap.podchat.util.Callback) RetrofitHelperMap(com.fanap.podchat.networking.retrofithelper.RetrofitHelperMap) DaggerMessageComponent(com.fanap.podchat.persistance.module.DaggerMessageComponent) RequestConnect(com.fanap.podchat.requestobject.RequestConnect) AssistantVo(com.fanap.podchat.chat.assistant.model.AssistantVo) ThreadInfoVO(com.fanap.podchat.mainmodel.ThreadInfoVO) Thread(com.fanap.podchat.mainmodel.Thread) RequestLeaveThread(com.fanap.podchat.requestobject.RequestLeaveThread) Constants(com.fanap.podchat.util.ChatMessageType.Constants) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CursorLoader(android.support.v4.content.CursorLoader) FileUpload(com.fanap.podchat.mainmodel.FileUpload) RequestSearchContact(com.fanap.podchat.mainmodel.RequestSearchContact) RequestGetPodSpaceImage(com.fanap.podchat.requestobject.RequestGetPodSpaceImage) PinMessage(com.fanap.podchat.chat.pin.pin_message.PinMessage) RequestBody(okhttp3.RequestBody) HashSet(java.util.HashSet) Inject(javax.inject.Inject) SearchSystemMetadataRequest(com.fanap.podchat.chat.messge.SearchSystemMetadataRequest) GetUserBotsResult(com.fanap.podchat.chat.bot.result_model.GetUserBotsResult) GapMessageVO(com.fanap.podchat.cachemodel.GapMessageVO) Contact(com.fanap.podchat.mainmodel.Contact) RetrofitHelperSsoHost(com.fanap.podchat.networking.retrofithelper.RetrofitHelperSsoHost) RequestSeenMessage(com.fanap.podchat.requestobject.RequestSeenMessage) RequestGetLastSeens(com.fanap.podchat.requestobject.RequestGetLastSeens) JsonSyntaxException(com.google.gson.JsonSyntaxException) CLOSING(com.fanap.podchat.util.ChatStateType.ChatSateConstant.CLOSING) RequestCreateThreadWithMessage(com.fanap.podchat.requestobject.RequestCreateThreadWithMessage) RequestGetMentionList(com.fanap.podchat.chat.mention.model.RequestGetMentionList) ResultPinMessage(com.fanap.podchat.chat.pin.pin_message.model.ResultPinMessage) LFileUpload(com.fanap.podchat.localmodel.LFileUpload) PodDownloader(com.fanap.podchat.chat.file_manager.download_file.PodDownloader) Util(com.fanap.podchat.util.Util) ResultSignalMessage(com.fanap.podchat.model.ResultSignalMessage) HandlerThread(android.os.HandlerThread) Bitmap(android.graphics.Bitmap) SentryLevel(io.sentry.core.SentryLevel) CLOSED(com.fanap.podchat.util.ChatStateType.ChatSateConstant.CLOSED) AppModule(com.fanap.podchat.persistance.module.AppModule) Activity(android.app.Activity) PodNotificationManager(com.fanap.podchat.notification.PodNotificationManager) Mention(com.fanap.podchat.chat.mention.Mention) ResultContact(com.fanap.podchat.model.ResultContact) ResultThreads(com.fanap.podchat.model.ResultThreads) ChatStateType(com.fanap.podchat.util.ChatStateType) StartAndStopBotRequest(com.fanap.podchat.chat.bot.request_model.StartAndStopBotRequest) CustomNotificationConfig(com.fanap.podchat.notification.CustomNotificationConfig) TypeToken(com.google.gson.reflect.TypeToken) SendingQueueCache(com.fanap.podchat.cachemodel.queue.SendingQueueCache) AsyncAckType(com.fanap.podchat.util.AsyncAckType) Uri(android.net.Uri) AddTagParticipantRequest(com.fanap.podchat.chat.tag.request_model.AddTagParticipantRequest) ResultHistory(com.fanap.podchat.model.ResultHistory) SSOApi(com.fanap.podchat.networking.api.SSOApi) RequestRemoveContact(com.fanap.podchat.requestobject.RequestRemoveContact) Looper(android.os.Looper) PinThread(com.fanap.podchat.chat.pin.pin_thread.PinThread) PingManager(com.fanap.podchat.chat.ping.PingManager) BotManager(com.fanap.podchat.chat.bot.BotManager) ProgressResponseBody(com.fanap.podchat.networking.ProgressResponseBody) RemoveTagParticipantRequest(com.fanap.podchat.chat.tag.request_model.RemoveTagParticipantRequest) RequestThreadInnerMessage(com.fanap.podchat.mainmodel.RequestThreadInnerMessage) ResponseBody(okhttp3.ResponseBody) CloseThreadRequest(com.fanap.podchat.chat.thread.request.CloseThreadRequest) RequestReplyFileMessage(com.fanap.podchat.requestobject.RequestReplyFileMessage) RequestDeliveredMessageList(com.fanap.podchat.requestobject.RequestDeliveredMessageList) ResultLeaveThread(com.fanap.podchat.model.ResultLeaveThread) ContactManager(com.fanap.podchat.chat.contact.ContactManager) Permission(com.fanap.podchat.util.Permission) AsyncMessage(com.fanap.podchat.mainmodel.AsyncMessage) Set(java.util.Set) CreateBotResult(com.fanap.podchat.chat.bot.result_model.CreateBotResult) RequestMuteThread(com.fanap.podchat.requestobject.RequestMuteThread) FileApi(com.fanap.podchat.networking.api.FileApi) RetryUpload(com.fanap.podchat.requestobject.RetryUpload) JsonArray(com.google.gson.JsonArray) AppDatabaseModule(com.fanap.podchat.persistance.module.AppDatabaseModule) MultipartBody(okhttp3.MultipartBody) TextMessageType(com.fanap.podchat.util.TextMessageType) RequestDeleteMessage(com.fanap.podchat.requestobject.RequestDeleteMessage) ASYNC_READY(com.fanap.podchat.util.ChatStateType.ChatSateConstant.ASYNC_READY) SentryEvent(io.sentry.core.SentryEvent) ResultDeleteMessage(com.fanap.podchat.mainmodel.ResultDeleteMessage) CacheParticipant(com.fanap.podchat.cachemodel.CacheParticipant) FileUtils(com.fanap.podchat.util.FileUtils) ResultJoinPublicThread(com.fanap.podchat.chat.thread.public_thread.ResultJoinPublicThread) ResultBlock(com.fanap.podchat.model.ResultBlock) ResultUpdateProfile(com.fanap.podchat.chat.user.profile.ResultUpdateProfile) PodChatException(com.fanap.podchat.util.PodChatException) RequestFileMessage(com.fanap.podchat.requestobject.RequestFileMessage) Environment(android.os.Environment) ThreadManager(com.fanap.podchat.chat.thread.ThreadManager) RetrofitHelperFileServer(com.fanap.podchat.networking.retrofithelper.RetrofitHelperFileServer) GetTagListRequest(com.fanap.podchat.chat.tag.request_model.GetTagListRequest) BitmapFactory(android.graphics.BitmapFactory) DefineBotCommandResult(com.fanap.podchat.chat.bot.result_model.DefineBotCommandResult) RequestJoinPublicThread(com.fanap.podchat.chat.thread.public_thread.RequestJoinPublicThread) Response(retrofit2.Response) PublicThread(com.fanap.podchat.chat.thread.public_thread.PublicThread) ArrayList(java.util.ArrayList) ContactRemove(com.fanap.podchat.model.ContactRemove) MapManager(com.fanap.podchat.chat.map.MapManager) SafeLeaveRequest(com.fanap.podchat.chat.thread.request.SafeLeaveRequest) RequestThreadParticipant(com.fanap.podchat.requestobject.RequestThreadParticipant) TagManager(com.fanap.podchat.chat.tag.TagManager) RequestAddParticipants(com.fanap.podchat.requestobject.RequestAddParticipants) RequestUnBlock(com.fanap.podchat.requestobject.RequestUnBlock) RequestThread(com.fanap.podchat.requestobject.RequestThread) RequestMapStaticImage(com.fanap.podchat.requestobject.RequestMapStaticImage) ResultThread(com.fanap.podchat.model.ResultThread) UserProfile(com.fanap.podchat.chat.user.profile.UserProfile) RequestGetHistory(com.fanap.podchat.requestobject.RequestGetHistory) CHAT_READY(com.fanap.podchat.util.ChatStateType.ChatSateConstant.CHAT_READY) TextUtils(android.text.TextUtils) GetMutualGroupRequest(com.fanap.podchat.chat.thread.request.GetMutualGroupRequest) AssistantManager(com.fanap.podchat.chat.assistant.AssistantManager) DeActiveAssistantRequest(com.fanap.podchat.chat.assistant.request_model.DeActiveAssistantRequest) ParticipantsManager(com.fanap.podchat.chat.participant.ParticipantsManager) File(java.io.File) ResultMessage(com.fanap.podchat.model.ResultMessage) OutPutMapRout(com.fanap.podchat.model.OutPutMapRout) BlockUnblockAssistantRequest(com.fanap.podchat.chat.assistant.request_model.BlockUnblockAssistantRequest) ChatDataSource(com.fanap.podchat.repository.ChatDataSource) RequestPinThread(com.fanap.podchat.chat.pin.pin_thread.model.RequestPinThread) CacheMessageVO(com.fanap.podchat.cachemodel.CacheMessageVO) RequestGetAdmin(com.fanap.podchat.requestobject.RequestGetAdmin) DefineBotCommandRequest(com.fanap.podchat.chat.bot.request_model.DefineBotCommandRequest) AndroidSchedulers(rx.android.schedulers.AndroidSchedulers) StatusPingResult(com.fanap.podchat.chat.ping.result.StatusPingResult) BlockedContact(com.fanap.podchat.mainmodel.BlockedContact) OutputSetRoleToUser(com.fanap.podchat.model.OutputSetRoleToUser) RequestPinMessage(com.fanap.podchat.chat.pin.pin_message.model.RequestPinMessage) PodThreadManager(com.fanap.podchat.util.PodThreadManager) SentryAndroid(io.sentry.android.core.SentryAndroid) AsyncAdapter(com.fanap.podasync.AsyncAdapter) OutPutParticipant(com.fanap.podchat.model.OutPutParticipant) RequestThreadInfo(com.fanap.podchat.requestobject.RequestThreadInfo) RequestBlockList(com.fanap.podchat.requestobject.RequestBlockList) Invitee(com.fanap.podchat.mainmodel.Invitee) RequestUploadImage(com.fanap.podchat.requestobject.RequestUploadImage) FileImageMetaData(com.fanap.podchat.model.FileImageMetaData) SearchManager(com.fanap.podchat.chat.search.SearchManager) OutputSignalMessage(com.fanap.podchat.model.OutputSignalMessage) MessageDatabaseHelper(com.fanap.podchat.persistance.MessageDatabaseHelper) MessageVO(com.fanap.podchat.mainmodel.MessageVO) ResultSetAdmin(com.fanap.podchat.model.ResultSetAdmin) DownloadManager(android.app.DownloadManager) CacheDataSource(com.fanap.podchat.repository.CacheDataSource) AssistantHistoryVo(com.fanap.podchat.chat.assistant.model.AssistantHistoryVo) RequestGetHashTagList(com.fanap.podchat.chat.hashtag.model.RequestGetHashTagList) ResultImageFile(com.fanap.podchat.model.ResultImageFile) RequestSeenMessageList(com.fanap.podchat.requestobject.RequestSeenMessageList) List(java.util.List) RequestMapRouting(com.fanap.podchat.requestobject.RequestMapRouting) RoomIntegrityException(com.fanap.podchat.persistance.RoomIntegrityException) PublishSubject(rx.subjects.PublishSubject) Contacts(com.fanap.podchat.model.Contacts) Context(android.content.Context) GetAssistantHistoryRequest(com.fanap.podchat.chat.assistant.request_model.GetAssistantHistoryRequest) ContactSyncedResult(com.fanap.podchat.chat.contact.result_model.ContactSyncedResult) History(com.fanap.podchat.mainmodel.History) TagVo(com.fanap.podchat.model.TagVo) NetworkPingSender(com.fanap.podchat.util.NetworkUtils.NetworkPingSender) HashMap(java.util.HashMap) GetUserBotsRequest(com.fanap.podchat.chat.bot.request_model.GetUserBotsRequest) Observable(rx.Observable) JsonElement(com.google.gson.JsonElement) Breadcrumb(io.sentry.core.Breadcrumb) WaitQueueCache(com.fanap.podchat.cachemodel.queue.WaitQueueCache) ResultUnreadMessagesCount(com.fanap.podchat.chat.messge.ResultUnreadMessagesCount) RequestMapSearch(com.fanap.podchat.util.RequestMapSearch) PodUploader(com.fanap.podchat.chat.file_manager.upload_file.PodUploader) TagParticipantResult(com.fanap.podchat.chat.tag.result_model.TagParticipantResult) ResultNotSeenDuration(com.fanap.podchat.model.ResultNotSeenDuration) UploadToPodSpaceResult(com.fanap.podchat.chat.file_manager.upload_file.UploadToPodSpaceResult) UserInfo(com.fanap.podchat.mainmodel.UserInfo) StartStopBotResult(com.fanap.podchat.chat.bot.result_model.StartStopBotResult) ResultThreadsSummary(com.fanap.podchat.model.ResultThreadsSummary) ResultStaticMapImage(com.fanap.podchat.model.ResultStaticMapImage) Cursor(android.database.Cursor) RequestMessage(com.fanap.podchat.requestobject.RequestMessage) ResultMute(com.fanap.podchat.model.ResultMute) RequestClearHistory(com.fanap.podchat.requestobject.RequestClearHistory) CreateBotRequest(com.fanap.podchat.chat.bot.request_model.CreateBotRequest) StatusPingRequest(com.fanap.podchat.chat.ping.request.StatusPingRequest) PhoneContact(com.fanap.podchat.cachemodel.PhoneContact) RequestEditMessage(com.fanap.podchat.requestobject.RequestEditMessage) ProgressRequestBody(com.fanap.podchat.networking.ProgressRequestBody) RequestBlock(com.fanap.podchat.requestobject.RequestBlock) FileImageUpload(com.fanap.podchat.model.FileImageUpload) ProgressHandler(com.fanap.podchat.ProgressHandler) RemoveParticipantRequest(com.fanap.podchat.requestobject.RemoveParticipantRequest) MapReverse(com.fanap.podchat.mainmodel.MapReverse) SecurePreferences(com.securepreferences.SecurePreferences) DeleteTagRequest(com.fanap.podchat.chat.tag.request_model.DeleteTagRequest) Collections(java.util.Collections) MimeTypeMap(android.webkit.MimeTypeMap) ResultUpdateContact(com.fanap.podchat.model.ResultUpdateContact) ChatResponse(com.fanap.podchat.model.ChatResponse) TagListResult(com.fanap.podchat.chat.tag.result_model.TagListResult)

Example 2 with TagListResult

use of com.fanap.podchat.chat.tag.result_model.TagListResult in project pod-chat-android-sdk by FanapSoft.

the class TagManager method prepareTagListResponse.

public static ChatResponse<TagListResult> prepareTagListResponse(ChatMessage chatMessage) {
    TagListResult tagsResult = new TagListResult();
    tagsResult.setTags(getTags(chatMessage));
    ChatResponse<TagListResult> finalResponse = new ChatResponse<>();
    finalResponse.setResult(tagsResult);
    finalResponse.setUniqueId(chatMessage.getUniqueId());
    finalResponse.setSubjectId(chatMessage.getSubjectId());
    return finalResponse;
}
Also used : ChatResponse(com.fanap.podchat.model.ChatResponse) TagListResult(com.fanap.podchat.chat.tag.result_model.TagListResult)

Example 3 with TagListResult

use of com.fanap.podchat.chat.tag.result_model.TagListResult in project pod-chat-android-sdk by FanapSoft.

the class TagCacheTest method populateCacheTags.

public void populateCacheTags() {
    chatListeners = new ChatListener() {

        @Override
        public void OnTagList(String content, ChatResponse<TagListResult> response) {
            if (response.isCache()) {
                System.out.println("Received List: " + content);
                cacheTags.addAll(response.getResult().getTags());
                chat.removeListener(chatListeners);
            }
            resumeProcess();
        }
    };
    chat.setListener(chatListeners);
    GetTagListRequest request = new GetTagListRequest.Builder().build();
    chat.getTagList(request);
    pauseProcess();
    System.out.println("Received List: " + cacheTags.size());
}
Also used : GetTagListRequest(com.fanap.podchat.chat.tag.request_model.GetTagListRequest) ChatListener(com.fanap.podchat.chat.ChatListener) TagListResult(com.fanap.podchat.chat.tag.result_model.TagListResult)

Example 4 with TagListResult

use of com.fanap.podchat.chat.tag.result_model.TagListResult in project pod-chat-android-sdk by FanapSoft.

the class TagCacheTest method populateServerTags.

public void populateServerTags() {
    chatListeners = new ChatListener() {

        @Override
        public void OnTagList(String content, ChatResponse<TagListResult> response) {
            if (!response.isCache()) {
                System.out.println("Received List: " + content);
                serverTags.addAll(response.getResult().getTags());
                chat.removeListener(chatListeners);
            }
            resumeProcess();
        }
    };
    chat.setListener(chatListeners);
    GetTagListRequest request = new GetTagListRequest.Builder().withNoCache().build();
    chat.getTagList(request);
    pauseProcess();
    System.out.println("Received List: " + serverTags.size());
}
Also used : GetTagListRequest(com.fanap.podchat.chat.tag.request_model.GetTagListRequest) ChatListener(com.fanap.podchat.chat.ChatListener) TagListResult(com.fanap.podchat.chat.tag.result_model.TagListResult)

Aggregations

TagListResult (com.fanap.podchat.chat.tag.result_model.TagListResult)4 GetTagListRequest (com.fanap.podchat.chat.tag.request_model.GetTagListRequest)3 ChatListener (com.fanap.podchat.chat.ChatListener)2 ChatResponse (com.fanap.podchat.model.ChatResponse)2 Activity (android.app.Activity)1 DownloadManager (android.app.DownloadManager)1 Context (android.content.Context)1 IntentFilter (android.content.IntentFilter)1 Cursor (android.database.Cursor)1 Bitmap (android.graphics.Bitmap)1 BitmapFactory (android.graphics.BitmapFactory)1 ConnectivityManager (android.net.ConnectivityManager)1 Uri (android.net.Uri)1 AsyncTask (android.os.AsyncTask)1 Environment (android.os.Environment)1 Handler (android.os.Handler)1 HandlerThread (android.os.HandlerThread)1 Looper (android.os.Looper)1 ContactsContract (android.provider.ContactsContract)1 MediaStore (android.provider.MediaStore)1