Home · Modules · All Classes · All Namespaces
Classes | Public Member Functions | Protected Member Functions | List of all members
Tp::ReceivedMessage Class Reference

The ReceivedMessage class is a subclass of Message, representing a received message only. More...

#include <TelepathyQt/ReceivedMessage>

Inherits Tp::Message.

Classes

class  DeliveryDetails
 The ReceivedMessage::DeliveryDetails class represents the details of a delivery report. More...
 

Public Member Functions

 ReceivedMessage (const ReceivedMessage &other)
 
ReceivedMessageoperator= (const ReceivedMessage &other)
 
 ~ReceivedMessage ()
 
QDateTime received () const
 
ContactPtr sender () const
 
QString senderNickname () const
 
QString supersededToken () const
 
bool isScrollback () const
 
bool isRescued () const
 
bool isSilent () const
 
bool isDeliveryReport () const
 
DeliveryDetails deliveryDetails () const
 
bool isFromChannel (const TextChannelPtr &channel) const
 
- Public Member Functions inherited from Tp::Message
 Message (ChannelTextMessageType, const QString &)
 
 Message (const Message &other)
 
 ~Message ()
 
Messageoperator= (const Message &other)
 
bool operator== (const Message &other) const
 
bool operator!= (const Message &other) const
 
QDateTime sent () const
 
ChannelTextMessageType messageType () const
 
bool isTruncated () const
 
bool hasNonTextContent () const
 
QString messageToken () const
 
bool isSpecificToDBusInterface () const
 
QString dbusInterface () const
 
QString text () const
 
MessagePart header () const
 
int size () const
 
MessagePart part (uint index) const
 
MessagePartList parts () const
 

Protected Member Functions

 ReceivedMessage (const MessagePartList &parts, const TextChannelPtr &channel)
 
 ReceivedMessage ()
 
uint senderHandle () const
 
QString senderId () const
 
uint pendingId () const
 
void setForceNonText ()
 
void clearSenderHandle ()
 
void setSender (const ContactPtr &sender)
 

Detailed Description

The ReceivedMessage class is a subclass of Message, representing a received message only.

It contains additional information that's generally only available on received messages.

Constructor & Destructor Documentation

◆ ReceivedMessage() [1/3]

Tp::ReceivedMessage::ReceivedMessage ( const ReceivedMessage other)

Copy constructor.

◆ ~ReceivedMessage()

Tp::ReceivedMessage::~ReceivedMessage ( )

Class destructor.

◆ ReceivedMessage() [2/3]

Tp::ReceivedMessage::ReceivedMessage ( const MessagePartList parts,
const TextChannelPtr &  channel 
)
protected

Construct a new ReceivedMessage object.

Parameters
partsThe parts of a message as defined by the Telepathy specification. This list must have length at least 1.
channelThe channel owning this message.

◆ ReceivedMessage() [3/3]

Tp::ReceivedMessage::ReceivedMessage ( )
protected

Member Function Documentation

◆ operator=()

ReceivedMessage & Tp::ReceivedMessage::operator= ( const ReceivedMessage other)

Assignment operator.

◆ received()

QDateTime Tp::ReceivedMessage::received ( ) const

Return the time the message was received.

Returns
The timestamp as QDateTime, or QDateTime() if unknown.

◆ sender()

ContactPtr Tp::ReceivedMessage::sender ( ) const

Return the contact who sent the message.

Returns
A pointer to the Contact object.
See also
senderNickname()

◆ senderNickname()

QString Tp::ReceivedMessage::senderNickname ( ) const

Return the nickname chosen by the sender of the message, which can be different for each message in a conversation.

Returns
The nickname.
See also
sender()

◆ supersededToken()

QString Tp::ReceivedMessage::supersededToken ( ) const

If this message replaces a previous message, return the value of messageToken() for that previous message. Otherwise, return an empty string.

For instance, a user interface could replace the superseded message with this message, or grey out the superseded message.

Returns
The message token of the superseded message or an empty string if none.

◆ isScrollback()

bool Tp::ReceivedMessage::isScrollback ( ) const

Return whether the incoming message was part of a replay of message history.

If true, loggers can use this to improve their heuristics for elimination of duplicate messages (a simple, correct implementation would be to avoid logging any message that has this flag).

Returns
true if the scrollback flag is set, false otherwise.

◆ isRescued()

bool Tp::ReceivedMessage::isRescued ( ) const

Return whether the incoming message was seen in a previous channel during the lifetime of the connection, but was not acknowledged before that channel closed, causing the channel in which it now appears to open.

If true, loggers should not log this message again.

Returns
true if the rescued flag is set, false otherwise.

◆ isSilent()

bool Tp::ReceivedMessage::isSilent ( ) const

Return whether the incoming message should trigger a user notification.

If true, UI should not notify the user about this message.

Returns
true if the silent flag is set, false otherwise.

◆ isDeliveryReport()

bool Tp::ReceivedMessage::isDeliveryReport ( ) const

Return whether the incoming message is a delivery report.

Returns
true if a delivery report, false otherwise.
See also
deliveryDetails()

◆ deliveryDetails()

ReceivedMessage::DeliveryDetails Tp::ReceivedMessage::deliveryDetails ( ) const

Return the details of a delivery report.

This method should only be used if isDeliveryReport() returns true.

Returns
The delivery report as a ReceivedMessage::DeliveryDetails object.
See also
isDeliveryReport()

◆ isFromChannel()

bool Tp::ReceivedMessage::isFromChannel ( const TextChannelPtr &  channel) const

Return whether this message is from channel.

Returns
true if the message is from channel, false otherwise.

◆ senderHandle()

uint Tp::ReceivedMessage::senderHandle ( ) const
protected

◆ senderId()

QString Tp::ReceivedMessage::senderId ( ) const
protected

◆ pendingId()

uint Tp::ReceivedMessage::pendingId ( ) const
protected

◆ setForceNonText()

void Tp::ReceivedMessage::setForceNonText ( )
protected

◆ clearSenderHandle()

void Tp::ReceivedMessage::clearSenderHandle ( )
protected

◆ setSender()

void Tp::ReceivedMessage::setSender ( const ContactPtr &  sender)
protected