本文整理汇总了C++中QXmppMessage::setMarkerId方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmppMessage::setMarkerId方法的具体用法?C++ QXmppMessage::setMarkerId怎么用?C++ QXmppMessage::setMarkerId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmppMessage
的用法示例。
在下文中一共展示了QXmppMessage::setMarkerId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testChatMarkers
//.........这里部分代码省略.........
"</message>");
QXmppMessage emptyThreadMessage;
parsePacket(emptyThreadMessage, emptyThreadXml);
QCOMPARE(emptyThreadMessage.isMarkable(), false);
QCOMPARE(emptyThreadMessage.marker(), QXmppMessage::Received);
QCOMPARE(emptyThreadMessage.id(), QString("message-2"));
QCOMPARE(emptyThreadMessage.markedId(), QString("message-1"));
QCOMPARE(emptyThreadMessage.thread(), QString());
QCOMPARE(emptyThreadMessage.markedThread(), QString());
const QByteArray notMarkableSerialisation(
"<message "
"id=\"message-3\" "
"to=\"[email protected]/westminster\" "
"from=\"[email protected]/throne\" "
"type=\"chat\"/>");
QXmppMessage serialisationMessage;
serialisationMessage.setFrom("[email protected]/throne");
serialisationMessage.setTo("[email protected]/westminster");
serialisationMessage.setId("message-3");
serialisationMessage.setMarkable(false);
serializePacket(serialisationMessage, notMarkableSerialisation);
const QByteArray markableSerialisation(
"<message "
"id=\"message-3\" "
"to=\"[email protected]/westminster\" "
"from=\"[email protected]/throne\" "
"type=\"chat\">"
"<markable xmlns=\"urn:xmpp:chat-markers:0\"/>"
"</message>");
serialisationMessage.setMarkable(true);
serializePacket(serialisationMessage, markableSerialisation);
const QByteArray receivedSerialisation(
"<message "
"id=\"message-3\" "
"to=\"[email protected]/westminster\" "
"from=\"[email protected]/throne\" "
"type=\"chat\">"
"<received xmlns=\"urn:xmpp:chat-markers:0\" "
"id=\"message-2\"/>"
"</message>");
serialisationMessage.setMarkable(false);
serialisationMessage.setMarker(QXmppMessage::Received);
serialisationMessage.setMarkerId("message-2");
serializePacket(serialisationMessage, receivedSerialisation);
const QByteArray receivedThreadSerialisation(
"<message "
"id=\"message-3\" "
"to=\"[email protected]/westminster\" "
"from=\"[email protected]/throne\" "
"type=\"chat\">"
"<received xmlns=\"urn:xmpp:chat-markers:0\" "
"id=\"message-2\" "
"thread=\"sleeping\"/>"
"</message>");
serialisationMessage.setMarker(QXmppMessage::Received);
serialisationMessage.setMarkerId("message-2");
serialisationMessage.setMarkedThread("sleeping");
serializePacket(serialisationMessage, receivedThreadSerialisation);
const QByteArray displayedThreadSerialisation(
"<message "
"id=\"message-3\" "
"to=\"[email protected]/westminster\" "
"from=\"[email protected]/throne\" "
"type=\"chat\">"
"<displayed xmlns=\"urn:xmpp:chat-markers:0\" "
"id=\"message-2\" "
"thread=\"sleeping\"/>"
"</message>");
serialisationMessage.setMarker(QXmppMessage::Displayed);
serialisationMessage.setMarkerId("message-2");
serialisationMessage.setMarkedThread("sleeping");
serializePacket(serialisationMessage, displayedThreadSerialisation);
const QByteArray acknowledgedThreadSerialisation(
"<message "
"id=\"message-3\" "
"to=\"[email protected]/westminster\" "
"from=\"[email protected]/throne\" "
"type=\"chat\">"
"<acknowledged xmlns=\"urn:xmpp:chat-markers:0\" "
"id=\"message-2\" "
"thread=\"sleeping\"/>"
"</message>");
serialisationMessage.setMarker(QXmppMessage::Acknowledged);
serialisationMessage.setMarkerId("message-2");
serialisationMessage.setMarkedThread("sleeping");
serializePacket(serialisationMessage, acknowledgedThreadSerialisation);
}