本文整理汇总了C++中QXmppMessage::thread方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmppMessage::thread方法的具体用法?C++ QXmppMessage::thread怎么用?C++ QXmppMessage::thread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmppMessage
的用法示例。
在下文中一共展示了QXmppMessage::thread方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testBasic
void tst_QXmppMessage::testBasic()
{
QFETCH(QByteArray, xml);
QFETCH(int, type);
QFETCH(QString, body);
QFETCH(QString, subject);
QFETCH(QString, thread);
QXmppMessage message;
parsePacket(message, xml);
QCOMPARE(message.to(), QString("[email protected]/QXmpp"));
QCOMPARE(message.from(), QString("[email protected]/QXmpp"));
QVERIFY(message.extendedAddresses().isEmpty());
QCOMPARE(int(message.type()), type);
QCOMPARE(message.body(), body);
QCOMPARE(message.subject(), subject);
QCOMPARE(message.thread(), thread);
QCOMPARE(message.state(), QXmppMessage::None);
QCOMPARE(message.isAttentionRequested(), false);
QCOMPARE(message.isReceiptRequested(), false);
QCOMPARE(message.hasForwarded(), false);
QCOMPARE(message.receiptId(), QString());
QCOMPARE(message.xhtml(), QString());
serializePacket(message, xml);
}
示例2: testMessageFull
void TestPackets::testMessageFull()
{
const QByteArray xml(
"<message to=\"[email protected]/QXmpp\" from=\"[email protected]/QXmpp\" type=\"normal\">"
"<subject>test subject</subject>"
"<body>test body & stuff</body>"
"<thread>test thread</thread>"
"<composing xmlns=\"http://jabber.org/protocol/chatstates\"/>"
"</message>");
QXmppMessage message;
parsePacket(message, xml);
QCOMPARE(message.to(), QString("[email protected]/QXmpp"));
QCOMPARE(message.from(), QString("[email protected]/QXmpp"));
QCOMPARE(message.type(), QXmppMessage::Normal);
QCOMPARE(message.body(), QString("test body & stuff"));
QCOMPARE(message.subject(), QString("test subject"));
QCOMPARE(message.thread(), QString("test thread"));
QCOMPARE(message.state(), QXmppMessage::Composing);
serializePacket(message, xml);
}
示例3: testChatMarkers
void tst_QXmppMessage::testChatMarkers()
{
const QByteArray markableXml(
"<message "
"from='[email protected]/westminster' "
"id='message-1' "
"to='[email protected]/throne'>"
"<thread>sleeping</thread>"
"<body>My lord, dispatch; read o'er these articles.</body>"
"<markable xmlns='urn:xmpp:chat-markers:0'/>"
"</message>");
QXmppMessage markableMessage;
parsePacket(markableMessage, markableXml);
QCOMPARE(markableMessage.isMarkable(), true);
QCOMPARE(markableMessage.marker(), QXmppMessage::NoMarker);
QCOMPARE(markableMessage.id(), QString("message-1"));
QCOMPARE(markableMessage.markedId(), QString());
QCOMPARE(markableMessage.thread(), QString("sleeping"));
QCOMPARE(markableMessage.markedThread(), QString());
const QByteArray receivedXml(
"<message "
"from='[email protected]/throne' "
"id='message-2' "
"to='[email protected]/westminster'>"
"<received xmlns='urn:xmpp:chat-markers:0' "
"id='message-1' "
"thread='sleeping'/>"
"</message>");
QXmppMessage receivedMessage;
parsePacket(receivedMessage, receivedXml);
QCOMPARE(receivedMessage.isMarkable(), false);
QCOMPARE(receivedMessage.marker(), QXmppMessage::Received);
QCOMPARE(receivedMessage.id(), QString("message-2"));
QCOMPARE(receivedMessage.markedId(), QString("message-1"));
QCOMPARE(receivedMessage.thread(), QString());
QCOMPARE(receivedMessage.markedThread(), QString("sleeping"));
const QByteArray displayedXml(
"<message "
"from='[email protected]/throne' "
"id='message-2' "
"to='[email protected]/westminster'>"
"<displayed xmlns='urn:xmpp:chat-markers:0' "
"id='message-1' "
"thread='sleeping'/>"
"</message>");
QXmppMessage displayedMessage;
parsePacket(displayedMessage, displayedXml);
QCOMPARE(displayedMessage.isMarkable(), false);
QCOMPARE(displayedMessage.marker(), QXmppMessage::Displayed);
QCOMPARE(displayedMessage.id(), QString("message-2"));
QCOMPARE(displayedMessage.markedId(), QString("message-1"));
QCOMPARE(displayedMessage.thread(), QString());
QCOMPARE(displayedMessage.markedThread(), QString("sleeping"));
const QByteArray acknowledgedXml(
"<message "
"from='[email protected]/throne' "
"id='message-2' "
"to='[email protected]/westminster'>"
"<acknowledged xmlns='urn:xmpp:chat-markers:0' "
"id='message-1' "
"thread='sleeping'/>"
"</message>");
QXmppMessage acknowledgedMessage;
parsePacket(acknowledgedMessage, acknowledgedXml);
QCOMPARE(acknowledgedMessage.isMarkable(), false);
QCOMPARE(acknowledgedMessage.marker(), QXmppMessage::Acknowledged);
QCOMPARE(acknowledgedMessage.id(), QString("message-2"));
QCOMPARE(acknowledgedMessage.markedId(), QString("message-1"));
QCOMPARE(acknowledgedMessage.thread(), QString());
QCOMPARE(acknowledgedMessage.markedThread(), QString("sleeping"));
const QByteArray emptyThreadXml(
"<message "
"from='[email protected]/throne' "
"id='message-2' "
"to='[email protected]/westminster'>"
"<received xmlns='urn:xmpp:chat-markers:0' "
"id='message-1'/>"
"</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\" "
//.........这里部分代码省略.........