use of com.fanap.podchat.chat.tag.request_model.GetTagListRequest 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;
}
use of com.fanap.podchat.chat.tag.request_model.GetTagListRequest 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());
}
use of com.fanap.podchat.chat.tag.request_model.GetTagListRequest 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());
}
use of com.fanap.podchat.chat.tag.request_model.GetTagListRequest in project pod-chat-android-sdk by FanapSoft.
the class ChatActivity method getTagList.
public void getTagList() {
GetTagListRequest request = new GetTagListRequest.Builder().build();
presenter.getTagList(request);
}
Aggregations