本文整理汇总了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;
}
示例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);
}
示例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;
}
示例4: isNotificationMessage
import com.quickblox.chat.model.QBChatMessage; //导入方法依赖的package包/类
public static boolean isNotificationMessage(QBChatMessage qbChatMessage) {
return qbChatMessage.getProperty(PROPERTY_NOTIFICATION_TYPE) != null;
}
示例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;
}
示例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;
}
示例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;
}