*
Rationale:
*
* Some protocols, like XMPP, echo the failing message back to the sender. This is sometimes the
* only way to match it against the sent message, so we include it here.
*
*
*
* \return The Message object, or an empty Message object if hasEchoedMessage()
* returns \c false.
* \sa hasEchoedMessage()
*/
Message ReceivedMessage::DeliveryDetails::echoedMessage() const
{
if (!isValid()) {
return Message();
}
return Message(partsFromPart(mPriv->parts, 0, "delivery-echo"));
}
/**
* \internal Default constructor.
*/
ReceivedMessage::ReceivedMessage()
{
}
/**
* Construct a new ReceivedMessage object.
*
* \param parts The parts of a message as defined by the \telepathy_spec.
* This list must have length at least 1.
* \param channel The channel owning this message.
*/
ReceivedMessage::ReceivedMessage(const MessagePartList &parts,
const TextChannelPtr &channel)
: Message(parts)
{
if (!mPriv->parts[0].contains(QLatin1String("message-received"))) {
mPriv->parts[0].insert(QLatin1String("message-received"),
QDBusVariant(static_cast