当前位置: 首页>>代码示例>>Java>>正文


Java DiscussionNotificationMessage类代码示例

本文整理汇总了Java中io.rong.message.DiscussionNotificationMessage的典型用法代码示例。如果您正苦于以下问题:Java DiscussionNotificationMessage类的具体用法?Java DiscussionNotificationMessage怎么用?Java DiscussionNotificationMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DiscussionNotificationMessage类属于io.rong.message包,在下文中一共展示了DiscussionNotificationMessage类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: translateMessageContent

import io.rong.message.DiscussionNotificationMessage; //导入依赖的package包/类
public static TranslatedMessageContent translateMessageContent(MessageContent msgContent) {
    TranslatedMessageContent content = null;
    if (msgContent == null)
        return null;

    if (msgContent instanceof TextMessage) {
        content = new TranslatedTextMessage(msgContent);
    } else if (msgContent instanceof ImageMessage) {
        content = new TranslatedImageMessage(msgContent);
    } else if (msgContent instanceof VoiceMessage) {
        content = new TranslatedVoiceMessage(msgContent);
    } else if (msgContent instanceof RichContentMessage) {
        content = new TranslatedRichContentMessage(msgContent);
    } else if (msgContent instanceof CommandNotificationMessage) {
        content = new TranslatedCommandNotificationMessage(msgContent);
    } else if (msgContent instanceof LocationMessage) {
        content = new TranslatedLocationMessage(msgContent);
    } else if (msgContent instanceof InformationNotificationMessage) {
        content = new TranslatedInformationNtfMessage(msgContent);
    } else if (msgContent instanceof DiscussionNotificationMessage) {
        content = new TranslatedDiscussionNtfMessage(msgContent);
    } else if (msgContent instanceof CommandMessage) {
        content = new TranslatedCommandMessage(msgContent);
    } else if (msgContent instanceof ContactNotificationMessage) {
        content = new TranslatedContactNtfMessage(msgContent);
    } else if (msgContent instanceof ProfileNotificationMessage) {
        content = new TranslatedProfileNtfMessage(msgContent);
    } else if (msgContent instanceof GroupNotificationMessage) {
        content = new TranslatedGrpNtfMessage(msgContent);
    }
    return content;
}
 
开发者ID:rongcloud,项目名称:apicloud-module-imlib-android,代码行数:33,代码来源:TranslatedMessage.java

示例2: TranslatedDiscussionNtfMessage

import io.rong.message.DiscussionNotificationMessage; //导入依赖的package包/类
public TranslatedDiscussionNtfMessage(MessageContent content) {
    DiscussionNotificationMessage message = (DiscussionNotificationMessage) content;
    this.extension = message.getExtension() == null ? "" : message.getExtension();
    this.operator = message.getOperator() == null ? "" : message.getOperator();
    this.type = message.getType();
}
 
开发者ID:rongcloud,项目名称:apicloud-module-imlib-android,代码行数:7,代码来源:TranslatedDiscussionNtfMessage.java

示例3: onReceived

import io.rong.message.DiscussionNotificationMessage; //导入依赖的package包/类
/**
 * 接收消息的监听器:OnReceiveMessageListener 的回调方法,接收到消息后执行。
 *
 * @param message 接收到的消息的实体信息。
 * @param left    剩余未拉取消息数目。
 */
@Override
public boolean onReceived(Message message, int left) {

    MessageContent messageContent = message.getContent();

    if (messageContent instanceof TextMessage) {//文本消息

        TextMessage textMessage = (TextMessage) messageContent;
        textMessage.getExtra();
        Log.d(TAG, "onReceived-TextMessage:" + textMessage.getContent());
    } else if (messageContent instanceof ImageMessage) {//图片消息

        ImageMessage imageMessage = (ImageMessage) messageContent;
        Log.d(TAG, "onReceived-ImageMessage:" + imageMessage.getRemoteUri());
    } else if (messageContent instanceof VoiceMessage) {//语音消息

        VoiceMessage voiceMessage = (VoiceMessage) messageContent;
        Log.d(TAG, "onReceived-voiceMessage:" + voiceMessage.getUri().toString());
    } else if (messageContent instanceof RichContentMessage) {//图文消息

        RichContentMessage richContentMessage = (RichContentMessage) messageContent;
        Log.d(TAG, "onReceived-RichContentMessage:" + richContentMessage.getContent());
    } else if (messageContent instanceof InformationNotificationMessage) {//小灰条消息

        InformationNotificationMessage informationNotificationMessage = (InformationNotificationMessage) messageContent;
        Log.e(TAG, "onReceived-informationNotificationMessage:" + informationNotificationMessage.getMessage());
        //if (FlyingIMContext.getInstance() != null)
        //  getFriendByUserIdHttpRequest = FlyingIMContext.getInstance().getUserInfoByUserId(message.getSenderUserId(), (ApiCallback<User>) this);
    }
    /*else if (messageContent instanceof AgreedFriendRequestMessage) {//好友添加成功消息

        AgreedFriendRequestMessage agreedFriendRequestMessage = (AgreedFriendRequestMessage) messageContent;
        Log.d(TAG, "onReceived-deAgreedFriendRequestMessage:" + agreedFriendRequestMessage.getMessage());
        Intent in = new Intent();
        in.setAction(MainActivity.ACTION_DMEO_AGREE_REQUEST);
        in.putExtra("AGREE_REQUEST", true);
        mContext.sendBroadcast(in);
    } else if (messageContent instanceof ContactNotificationMessage) {//好友添加消息

        ContactNotificationMessage contactContentMessage = (ContactNotificationMessage) messageContent;
        Log.d(TAG, "onReceived-ContactNotificationMessage:getExtra;" + contactContentMessage.getExtra());
        Log.d(TAG, "onReceived-ContactNotificationMessage:+getmessage:" + contactContentMessage.getMessage().toString());
        Intent in = new Intent();
        in.setAction(MainActivity.ACTION_DMEO_RECEIVE_MESSAGE);
        in.putExtra("rongCloud", contactContentMessage);
        in.putExtra("has_message", true);
        mContext.sendBroadcast(in);
    }
    */else if (messageContent instanceof DiscussionNotificationMessage) {//讨论组通知消息

        DiscussionNotificationMessage discussionNotificationMessage = (DiscussionNotificationMessage) messageContent;
        Log.d(TAG, "onReceived-discussionNotificationMessage:getExtra;" + discussionNotificationMessage.getOperator());
        setDiscussionName(message.getTargetId());
    } else {
        Log.d(TAG, "onReceived-其他消息,自己来判断处理");
    }

    //通知更新菜单
    Intent in = new Intent();
    in.setAction(MainActivity.ACTION_RONGCLOUD_RECEIVE_MESSAGE);
    in.putExtra("rongMessage", message);
    in.putExtra("has_message", true);
    mContext.sendBroadcast(in);

    return false;

}
 
开发者ID:birdcopy,项目名称:Android-Birdcopy-Application,代码行数:74,代码来源:RongCloudEvent.java


注:本文中的io.rong.message.DiscussionNotificationMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。