本文整理匯總了Java中org.jivesoftware.smack.packet.Message.getThread方法的典型用法代碼示例。如果您正苦於以下問題:Java Message.getThread方法的具體用法?Java Message.getThread怎麽用?Java Message.getThread使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jivesoftware.smack.packet.Message
的用法示例。
在下文中一共展示了Message.getThread方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createChat
import org.jivesoftware.smack.packet.Message; //導入方法依賴的package包/類
/**
* Creates a new {@link Chat} based on the message. May returns null if no chat could be
* created, e.g. because the message comes without from.
*
* @param message
* @return a Chat or null if none can be created
*/
private Chat createChat(Message message) {
String userJID = message.getFrom();
// According to RFC6120 8.1.2.1 4. messages without a 'from' attribute are valid, but they
// are of no use in this case for ChatManager
if (userJID == null) {
return null;
}
String threadID = message.getThread();
if(threadID == null) {
threadID = nextID();
}
return createChat(userJID, threadID, false);
}