Search in sources :

Example 1 with TagParticipantResult

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

the class TagManager method prepareTagParticipantResponse.

public static ChatResponse<TagParticipantResult> prepareTagParticipantResponse(ChatMessage chatMessage) {
    TagParticipantResult tagParticipantResult = new TagParticipantResult();
    tagParticipantResult.setTagParticipans(App.getGson().fromJson(chatMessage.getContent(), new TypeToken<ArrayList<TagParticipantVO>>() {
    }.getType()));
    ChatResponse<TagParticipantResult> finalResponse = new ChatResponse<>();
    finalResponse.setResult(tagParticipantResult);
    finalResponse.setUniqueId(chatMessage.getUniqueId());
    finalResponse.setSubjectId(chatMessage.getSubjectId());
    return finalResponse;
}
Also used : ChatResponse(com.fanap.podchat.model.ChatResponse) TagParticipantResult(com.fanap.podchat.chat.tag.result_model.TagParticipantResult) ArrayList(java.util.ArrayList)

Example 2 with TagParticipantResult

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

the class TagCacheTest method addTagParticipant.

public void addTagParticipant(long tagId) {
    chatListeners = new ChatListener() {

        @Override
        public void OnTagParticipantAdded(String content, ChatResponse<TagParticipantResult> response) {
            chat.removeListener(chatListeners);
            resumeProcess();
        }
    };
    chat.setListener(chatListeners);
    List<Long> threadIds = new ArrayList<>();
    threadIds.add(8688l);
    threadIds.add(8730l);
    threadIds.add(8729l);
    AddTagParticipantRequest request = new AddTagParticipantRequest.Builder(tagId, threadIds).build();
    chat.addTagParticipant(request);
    pauseProcess();
    System.out.println("Tag Participant Added: ");
}
Also used : AddTagParticipantRequest(com.fanap.podchat.chat.tag.request_model.AddTagParticipantRequest) ChatListener(com.fanap.podchat.chat.ChatListener) TagParticipantResult(com.fanap.podchat.chat.tag.result_model.TagParticipantResult) ArrayList(java.util.ArrayList)

Example 3 with TagParticipantResult

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

the class TagCacheTest method removeTagParticipant.

public void removeTagParticipant(long tagId) {
    chatListeners = new ChatListener() {

        @Override
        public void OnTagParticipantRemoved(String content, ChatResponse<TagParticipantResult> response) {
            chat.removeListener(chatListeners);
            resumeProcess();
        }
    };
    chat.setListener(chatListeners);
    List<Long> threadIds = new ArrayList<>();
    threadIds.add(8688l);
    threadIds.add(8730l);
    threadIds.add(8729l);
    RemoveTagParticipantRequest request = new RemoveTagParticipantRequest.Builder(tagId, threadIds).build();
    chat.removeTagParticipant(request);
    pauseProcess();
    System.out.println("Tag Participant Removed: ");
}
Also used : RemoveTagParticipantRequest(com.fanap.podchat.chat.tag.request_model.RemoveTagParticipantRequest) ChatListener(com.fanap.podchat.chat.ChatListener) TagParticipantResult(com.fanap.podchat.chat.tag.result_model.TagParticipantResult) ArrayList(java.util.ArrayList)

Aggregations

TagParticipantResult (com.fanap.podchat.chat.tag.result_model.TagParticipantResult)3 ArrayList (java.util.ArrayList)3 ChatListener (com.fanap.podchat.chat.ChatListener)2 AddTagParticipantRequest (com.fanap.podchat.chat.tag.request_model.AddTagParticipantRequest)1 RemoveTagParticipantRequest (com.fanap.podchat.chat.tag.request_model.RemoveTagParticipantRequest)1 ChatResponse (com.fanap.podchat.model.ChatResponse)1