Search in sources :

Example 1 with EMAMessage

use of com.hyphenate.chat.adapter.message.EMAMessage in project SmartCampus by Vegen.

the class EaseDingMessageHelperTest method createDingMessage.

private EMMessage createDingMessage(String conversationId, String originalMsgId) {
    EMAMessage _msg = EMAMessage.createSendMessage("", "", null, EMMessage.ChatType.Chat.ordinal());
    _msg.setTo(conversationId);
    EMMessage msg = new EMMessage(_msg);
    msg.setMsgId(originalMsgId);
    EMTextMessageBody txtBody = new EMTextMessageBody("1");
    msg.addBody(txtBody);
    msg.setAttribute(KEY_DING, true);
    msg.setChatType(EMMessage.ChatType.GroupChat);
    return msg;
}
Also used : EMTextMessageBody(com.hyphenate.chat.EMTextMessageBody) EMAMessage(com.hyphenate.chat.adapter.message.EMAMessage) EMMessage(com.hyphenate.chat.EMMessage)

Example 2 with EMAMessage

use of com.hyphenate.chat.adapter.message.EMAMessage in project SmartCampus by Vegen.

the class EaseDingMessageHelperTest method createDingAckMessage.

private EMMessage createDingAckMessage(String conversationId, String originalMsgId, String from) {
    EMAMessage _msg = EMAMessage.createSendMessage(from, "", null, EMMessage.ChatType.Chat.ordinal());
    EMMessage msg = new EMMessage(_msg);
    msg.setAttribute(KEY_CONVERSATION_ID, conversationId);
    msg.setAttribute(KEY_DING_ACK, true);
    msg.addBody(new EMCmdMessageBody(originalMsgId));
    return msg;
}
Also used : EMCmdMessageBody(com.hyphenate.chat.EMCmdMessageBody) EMAMessage(com.hyphenate.chat.adapter.message.EMAMessage) EMMessage(com.hyphenate.chat.EMMessage)

Aggregations

EMMessage (com.hyphenate.chat.EMMessage)2 EMAMessage (com.hyphenate.chat.adapter.message.EMAMessage)2 EMCmdMessageBody (com.hyphenate.chat.EMCmdMessageBody)1 EMTextMessageBody (com.hyphenate.chat.EMTextMessageBody)1