本文整理匯總了Java中org.jivesoftware.smack.packet.Message.hasExtension方法的典型用法代碼示例。如果您正苦於以下問題:Java Message.hasExtension方法的具體用法?Java Message.hasExtension怎麽用?Java Message.hasExtension使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jivesoftware.smack.packet.Message
的用法示例。
在下文中一共展示了Message.hasExtension方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isMessageCorrection
import org.jivesoftware.smack.packet.Message; //導入方法依賴的package包/類
private boolean isMessageCorrection(Message message) {
return message.hasExtension(MessageCorrectExtension.ELEMENT, MessageCorrectExtension.NAMESPACE);
}
示例2: manageMessageReceived
import org.jivesoftware.smack.packet.Message; //導入方法依賴的package包/類
private void manageMessageReceived(Message message, Date delayDate, String messageId, boolean fromMam) {
String[] jidList = message.getFrom().toString().split("/");
ChatMessage chatMessage = new ChatMessage();
chatMessage.setMessageId(messageId);
String chatRoomJID;
if (!jidList[0].equals(Preferences.getInstance().getUserXMPPJid())) {
chatRoomJID = jidList[0];
} else {
chatRoomJID = message.getTo().toString().split("/")[0];
}
chatMessage.setRoomJid(chatRoomJID);
// not saving messages with my affiliation changes to "none", and delete the chat in that case
if (checkIfMyIsAffiliationNone(message)) {
deleteChat(chatRoomJID);
return;
}
if (message.hasExtension(JivePropertiesExtension.ELEMENT, JivePropertiesExtension.NAMESPACE)) {
return;
}
RoomsListManager.getInstance().createChatIfNotExists(chatRoomJID, true);
manageSender(jidList, chatMessage, chatRoomJID);
chatMessage.setStatus(ChatMessage.STATUS_SENT);
chatMessage.setUnread(true);
if (isBoBMessage(message)) {
BoBExtension bobExtension = BoBExtension.from(message);
chatMessage.setContent(Base64.decodeToString(bobExtension.getBoBHash().getHash()));
chatMessage.setType(ChatMessage.TYPE_STICKER);
} else {
chatMessage.setContent(message.getBody());
chatMessage.setType(ChatMessage.TYPE_CHAT);
}
Realm realm = RealmManager.getInstance().getRealm();
Chat chatRoom = realm.where(Chat.class).equalTo("jid", chatRoomJID).findFirst();
realm.beginTransaction();
if (canBeTextMessageOrSticker(message) && !fromMam) {
chatRoom.addUnreadMessage();
}
// room name or subject change
manageConfigurationsChange(message, chatMessage, chatRoom);
// not saving invalid messages
if (chatMessage.getContent() == null || chatMessage.getContent().isEmpty() || chatMessage.getUserSender() == null) {
realm.commitTransaction();
realm.close();
return;
}
// assign date
manageDelayDate(delayDate, chatMessage);
realm.copyToRealmOrUpdate(chatMessage);
realm.commitTransaction();
realm.close();
}
示例3: isBoBMessage
import org.jivesoftware.smack.packet.Message; //導入方法依賴的package包/類
private boolean isBoBMessage(Message message) {
return message.hasExtension(BoBExtension.ELEMENT, BoBExtension.NAMESPACE);
}
示例4: hasConfigurationChangeExtension
import org.jivesoftware.smack.packet.Message; //導入方法依賴的package包/類
private boolean hasConfigurationChangeExtension(Message message) {
return message.hasExtension(MUCLightElements.ConfigurationsChangeExtension.ELEMENT, MUCLightElements.ConfigurationsChangeExtension.NAMESPACE);
}
示例5: hasAffiliationsChangeExtension
import org.jivesoftware.smack.packet.Message; //導入方法依賴的package包/類
private boolean hasAffiliationsChangeExtension(Message message) {
return message.hasExtension(MUCLightElements.AffiliationsChangeExtension.ELEMENT, MUCLightElements.AffiliationsChangeExtension.NAMESPACE);
}