Search in sources :

Example 1 with TagResult

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

the class TagCacheTest method editTag.

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

        @Override
        public void onTagEdited(String content, ChatResponse<TagResult> response) {
            chat.removeListener(chatListeners);
            resumeProcess();
        }
    };
    chat.setListener(chatListeners);
    EditTagRequest request = new EditTagRequest.Builder(tagId, "EditedTag_" + System.currentTimeMillis()).build();
    chat.editTag(request);
    pauseProcess();
    System.out.println("Tag Edited: ");
}
Also used : EditTagRequest(com.fanap.podchat.chat.tag.request_model.EditTagRequest) ChatListener(com.fanap.podchat.chat.ChatListener) TagResult(com.fanap.podchat.chat.tag.result_model.TagResult)

Example 2 with TagResult

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

the class TagManager method prepareTagResponse.

public static ChatResponse<TagResult> prepareTagResponse(ChatMessage chatMessage) {
    TagVo tag = App.getGson().fromJson(chatMessage.getContent(), TagVo.class);
    TagResult tagResult = new TagResult(tag);
    ChatResponse<TagResult> finalResponse = new ChatResponse<>();
    finalResponse.setResult(tagResult);
    finalResponse.setUniqueId(chatMessage.getUniqueId());
    finalResponse.setSubjectId(chatMessage.getSubjectId());
    return finalResponse;
}
Also used : ChatResponse(com.fanap.podchat.model.ChatResponse) TagResult(com.fanap.podchat.chat.tag.result_model.TagResult) TagVo(com.fanap.podchat.model.TagVo) CacheTagVo(com.fanap.podchat.cachemodel.CacheTagVo)

Example 3 with TagResult

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

the class TagCacheTest method deleteTag.

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

        @Override
        public void onTagDeleted(String content, ChatResponse<TagResult> response) {
            chat.removeListener(chatListeners);
            resumeProcess();
        }
    };
    chat.setListener(chatListeners);
    DeleteTagRequest request = new DeleteTagRequest.Builder(tagId).build();
    chat.deleteTag(request);
    pauseProcess();
    System.out.println("Tag Deleted: ");
}
Also used : DeleteTagRequest(com.fanap.podchat.chat.tag.request_model.DeleteTagRequest) ChatListener(com.fanap.podchat.chat.ChatListener) TagResult(com.fanap.podchat.chat.tag.result_model.TagResult)

Example 4 with TagResult

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

the class TagCacheTest method addNewTag.

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

        @Override
        public void onTagCreated(String content, ChatResponse<TagResult> response) {
            chat.removeListener(chatListeners);
            resumeProcess();
            tagId = response.getResult().getTag().getTagId();
        }
    };
    chat.setListener(chatListeners);
    CreateTagRequest request = new CreateTagRequest.Builder("Tag_" + System.currentTimeMillis() / 1000).build();
    chat.createTag(request);
    pauseProcess();
    System.out.println("New Tag Created: ");
}
Also used : ChatListener(com.fanap.podchat.chat.ChatListener) CreateTagRequest(com.fanap.podchat.chat.tag.request_model.CreateTagRequest) TagResult(com.fanap.podchat.chat.tag.result_model.TagResult)

Aggregations

TagResult (com.fanap.podchat.chat.tag.result_model.TagResult)4 ChatListener (com.fanap.podchat.chat.ChatListener)3 CacheTagVo (com.fanap.podchat.cachemodel.CacheTagVo)1 CreateTagRequest (com.fanap.podchat.chat.tag.request_model.CreateTagRequest)1 DeleteTagRequest (com.fanap.podchat.chat.tag.request_model.DeleteTagRequest)1 EditTagRequest (com.fanap.podchat.chat.tag.request_model.EditTagRequest)1 ChatResponse (com.fanap.podchat.model.ChatResponse)1 TagVo (com.fanap.podchat.model.TagVo)1