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


Java QBChatMessage.getProperty方法代码示例

本文整理汇总了Java中com.quickblox.chat.model.QBChatMessage.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java QBChatMessage.getProperty方法的具体用法?Java QBChatMessage.getProperty怎么用?Java QBChatMessage.getProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.quickblox.chat.model.QBChatMessage的用法示例。


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

示例1: parseDialogFromQBMessage

import com.quickblox.chat.model.QBChatMessage; //导入方法依赖的package包/类
public static QBChatDialog parseDialogFromQBMessage(Context context, QBChatMessage qbChatMessage, QBDialogType qbDialogType) {
    String dialogId = qbChatMessage.getDialogId();
    String currentOccupantsIdsString = (String) qbChatMessage.getProperty(PROPERTY_ROOM_CURRENT_OCCUPANTS_IDS);
    String addedOccupantsIdsString = (String) qbChatMessage.getProperty(PROPERTY_ROOM_ADDED_OCCUPANTS_IDS);
    String dialogName = (String) qbChatMessage.getProperty(PROPERTY_ROOM_NAME);
    String photoUrl = (String) qbChatMessage.getProperty(PROPERTY_ROOM_PHOTO);
    long dateSent = ChatUtils.getMessageDateSent(qbChatMessage);
    String updatedAtString = (String) qbChatMessage.getProperty(PROPERTY_ROOM_UPDATED_AT);
    String roomJid = ChatUtils.getRoomJid(dialogId);

    QBChatDialog qbDialog = new QBChatDialog(dialogId);
    qbDialog.setRoomJid(roomJid);
    qbDialog.setPhoto(photoUrl);
    qbDialog.setType(qbDialogType);

    qbDialog.setName(dialogName);

    if (!TextUtils.isEmpty(currentOccupantsIdsString)) {
        qbDialog.setOccupantsIds((ArrayList<Integer>) ChatUtils.getOccupantsIdsListFromString(currentOccupantsIdsString));
    } else if (!TextUtils.isEmpty(addedOccupantsIdsString)) {
        qbDialog.setOccupantsIds((ArrayList<Integer>) ChatUtils.getOccupantsIdsListFromString(addedOccupantsIdsString));
    }

    if (!CollectionUtils.isEmpty(qbChatMessage.getAttachments())) {
        qbDialog.setLastMessage(context.getString(R.string.dlg_attached_last_message));
    } else if (!TextUtils.isEmpty(qbChatMessage.getBody())) {
        qbDialog.setLastMessage(qbChatMessage.getBody());
    }

    qbDialog.setLastMessageDateSent(dateSent);
    qbDialog.setUnreadMessageCount(ConstsCore.ZERO_INT_VALUE);

    if (!TextUtils.isEmpty(updatedAtString)) {
        qbDialog.setUpdatedAt(new Date(Long.parseLong(updatedAtString)));
    }

    return qbDialog;
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:39,代码来源:ChatNotificationUtils.java

示例2: updateDialogFromQBMessage

import com.quickblox.chat.model.QBChatMessage; //导入方法依赖的package包/类
public static void updateDialogFromQBMessage(Context context, DataManager dataManager, QBChatMessage qbChatMessage, QBChatDialog qbDialog) {
    String lastMessage = getBodyForUpdateChatNotificationMessage(context, dataManager, qbChatMessage);
    String dialogName = (String) qbChatMessage.getProperty(PROPERTY_ROOM_NAME);
    String photoUrl = (String) qbChatMessage.getProperty(PROPERTY_ROOM_PHOTO);
    String updatedInfo = (String) qbChatMessage.getProperty(PROPERTY_ROOM_UPDATE_INFO);
    String currentOccupantsIdsString = (String) qbChatMessage.getProperty(PROPERTY_ROOM_CURRENT_OCCUPANTS_IDS);
    String deletedOccupantsIdsString = (String) qbChatMessage.getProperty(PROPERTY_ROOM_DELETED_OCCUPANTS_IDS);

    ChatNotificationType chatNotificationType = null;

    if (updatedInfo != null) {
        chatNotificationType = ChatNotificationType.parseByValue(Integer.parseInt(updatedInfo));
    }

    if (chatNotificationType != null) {
        switch (chatNotificationType) {
            case CHAT_PHOTO:
                setDialogPhoto(qbDialog, photoUrl);
                break;
            case CHAT_NAME:
                setDialogName(qbDialog, dialogName);
                break;
            case CHAT_OCCUPANTS:
                setDialogOccupants(dataManager, qbDialog.getDialogId(), currentOccupantsIdsString, deletedOccupantsIdsString);
                break;
        }
    }

    qbDialog.setLastMessage(lastMessage);
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:31,代码来源:ChatNotificationUtils.java

示例3: getMessageDateSent

import com.quickblox.chat.model.QBChatMessage; //导入方法依赖的package包/类
public static long getMessageDateSent(QBChatMessage qbChatMessage) {
    long dateSent;
    String dateSentString = (String) qbChatMessage.getProperty(ChatNotificationUtils.PROPERTY_DATE_SENT);
    try {
        dateSent = dateSentString != null ? Long.parseLong(dateSentString) : qbChatMessage.getDateSent();
    } catch (NumberFormatException e) {
        dateSent = DateUtilsCore.getCurrentTime();
    }
    return dateSent;
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:11,代码来源:ChatUtils.java

示例4: isNotificationMessage

import com.quickblox.chat.model.QBChatMessage; //导入方法依赖的package包/类
public static boolean isNotificationMessage(QBChatMessage qbChatMessage) {
    return qbChatMessage.getProperty(PROPERTY_NOTIFICATION_TYPE) != null;
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:4,代码来源:ChatNotificationUtils.java

示例5: getUpdateChatLocalNotificationType

import com.quickblox.chat.model.QBChatMessage; //导入方法依赖的package包/类
public static DialogNotification.Type getUpdateChatLocalNotificationType(QBChatMessage qbChatMessage) {
    String notificationTypeString = (String) qbChatMessage.getProperty(PROPERTY_NOTIFICATION_TYPE);
    String updatedInfo = (String) qbChatMessage.getProperty(PROPERTY_ROOM_UPDATE_INFO);

    NotificationType notificationType = null;
    ChatNotificationType chatNotificationType = null;

    if (notificationTypeString != null) {
        notificationType = NotificationType.parseByValue(Integer.parseInt(notificationTypeString));
    }

    if (updatedInfo != null) {
        chatNotificationType = ChatNotificationType.parseByValue(Integer.parseInt(updatedInfo));
    }

    DialogNotification.Type dialogNotificationTypeLocal = null;

    if (chatNotificationType != null) {
        switch (chatNotificationType) {
            case CHAT_PHOTO:
                dialogNotificationTypeLocal = DialogNotification.Type.PHOTO_DIALOG;
                break;
            case CHAT_NAME:
                dialogNotificationTypeLocal = DialogNotification.Type.NAME_DIALOG;
                break;
            case CHAT_OCCUPANTS:
                dialogNotificationTypeLocal = DialogNotification.Type.OCCUPANTS_DIALOG;
                break;
        }
    }

    if (notificationType != null && chatNotificationType == null
            && notificationType.equals(NotificationType.GROUP_CHAT_CREATE)) {
        dialogNotificationTypeLocal = DialogNotification.Type.CREATE_DIALOG;
    }

    if (notificationType != null && notificationType.equals(NotificationType.GROUP_CHAT_UPDATE)) {
        dialogNotificationTypeLocal = DialogNotification.Type.ADDED_DIALOG;
    }

    return dialogNotificationTypeLocal;
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:43,代码来源:ChatNotificationUtils.java

示例6: isNotificationToGroupChat

import com.quickblox.chat.model.QBChatMessage; //导入方法依赖的package包/类
private boolean isNotificationToGroupChat(QBChatMessage chatMessage) {
    String updatedInfo = (String) chatMessage.getProperty(ChatNotificationUtils.PROPERTY_ROOM_UPDATE_INFO);
    return updatedInfo != null;
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:5,代码来源:QBChatHelper.java

示例7: isNotificationDeletedGroupChat

import com.quickblox.chat.model.QBChatMessage; //导入方法依赖的package包/类
private boolean isNotificationDeletedGroupChat(QBChatMessage chatMessage) {
    String deletedOccupantsIdsString = (String) chatMessage.getProperty(ChatNotificationUtils.PROPERTY_ROOM_DELETED_OCCUPANTS_IDS);
    return deletedOccupantsIdsString != null;
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:5,代码来源:QBChatHelper.java


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