Top |
guint | tp_message_count_parts () |
GVariant * | tp_message_dup_part () |
gchar * | tp_message_to_text () |
TpChannelTextMessageType | tp_message_get_message_type () |
gint64 | tp_message_get_received_timestamp () |
gint64 | tp_message_get_sent_timestamp () |
gchar * | tp_message_dup_specific_to_interface () |
gchar * | tp_message_dup_supersedes () |
gchar * | tp_message_dup_token () |
gboolean | tp_message_is_delivery_report () |
gboolean | tp_message_is_rescued () |
gboolean | tp_message_is_scrollback () |
guint32 | tp_message_get_pending_message_id () |
gboolean | tp_message_is_mutable () |
guint | tp_message_append_part () |
gboolean | tp_message_delete_key () |
void | tp_message_delete_part () |
void | tp_message_set_variant () |
void | tp_message_set_boolean () |
void | tp_message_set_bytes () |
#define | tp_message_set_int16() |
void | tp_message_set_int32 () |
void | tp_message_set_int64 () |
void | tp_message_set_string () |
void | tp_message_set_string_printf () |
#define | tp_message_set_uint16() |
void | tp_message_set_uint32 () |
void | tp_message_set_uint64 () |
GVariant * tp_message_dup_part (TpMessage *self
,guint part
);
the current contents of the given part, or NULL
if the part number is
out of range.
[transfer full]
Since 0.19.10
gchar *
tp_message_to_text (TpMessage *message
);
Concatene all the text parts contained in message
.
Since 0.13.9
TpChannelTextMessageType
tp_message_get_message_type (TpMessage *self
);
Since 0.13.10
gint64
tp_message_get_received_timestamp (TpMessage *self
);
Return when this message was received locally, as a number of seconds since
the beginning of 1970 in the UTC timezone (the same representation used by
g_date_time_new_from_unix_utc()
, for instance), or 0 if not known.
Since 0.13.9
gint64
tp_message_get_sent_timestamp (TpMessage *self
);
Return when this message was sent, as a number of seconds since the
beginning of 1970 in the UTC timezone (the same representation used by
g_date_time_new_from_unix_utc()
, for instance), or 0 if not known.
If this protocol does not track the time at which the message was initially sent, this timestamp might be approximated by using the time at which it arrived at a central server.
Since 0.13.9
gchar *
tp_message_dup_specific_to_interface (TpMessage *self
);
If this message is specific to a particular D-Bus interface and should be ignored by clients without knowledge of that interface, return the name of the interface.
If this message is an ordinary message or delivery report, return NULL
.
gchar *
tp_message_dup_supersedes (TpMessage *self
);
If this message replaces a previous message, return the value of
tp_message_dup_token()
for that previous message. Otherwise, return NULL
.
For instance, a user interface could replace the superseded message with this message, or grey out the superseded message.
gchar *
tp_message_dup_token (TpMessage *self
);
Return this message's identifier in the underlying protocol. This is not guaranteed to be unique, even within the scope of a single channel or contact: the only guarantee made is that two messages with different non-empty tokens are different messages.
If there is no suitable token, return NULL
.
Since 0.13.9
gboolean
tp_message_is_delivery_report (TpMessage *self
);
If this message is a delivery report indicating success or failure of
delivering a message, return TRUE
.
Since 0.13.9
gboolean
tp_message_is_rescued (TpMessage *self
);
Returns TRUE
if this incoming message has been seen in a previous channel
during the lifetime of the Connection, but had not been acknowledged when
that channel closed, causing an identical channel (in which the message now
appears) to open.
Loggers should check this flag to avoid duplicating messages, for instance.
Since 0.13.9
gboolean
tp_message_is_scrollback (TpMessage *self
);
TRUE
if this message is part of a replay of message history, for
instance in an XMPP chatroom.
Since 0.13.9
guint32 tp_message_get_pending_message_id (TpMessage *self
,gboolean *valid
);
Return the incoming message ID of self
. Only incoming messages have such
ID, for outgoing ones this function returns 0 and set valid
to FALSE
.
Since 0.15.3
gboolean
tp_message_is_mutable (TpMessage *self
);
Check if self
is mutable. Only mutable messages can be modified using
functions such as tp_message_set_string()
.
Since 0.13.9
guint
tp_message_append_part (TpMessage *self
);
Append a body part to the message.
Since 0.7.21
gboolean tp_message_delete_key (TpMessage *self
,guint part
,const gchar *key
);
Remove the given key and its value from the given part.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
Since 0.7.21
void tp_message_delete_part (TpMessage *self
,guint part
);
Delete the given body part from the message.
self |
a message |
|
part |
a part number, which must be strictly greater than 0, and strictly
less than the number returned by |
Since 0.7.21
void tp_message_set_variant (TpMessage *self
,guint part
,const gchar *key
,GVariant *value
);
Set key
in part part
of self
to have value
as its value.
If value
is a floating reference (see g_variant_ref_sink()
), then this
function will take ownership of it.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
|
value |
a value |
Since 0.19.10
void tp_message_set_boolean (TpMessage *self
,guint part
,const gchar *key
,gboolean b
);
Set key
in part part
of self
to have b
as a boolean value.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
|
b |
a boolean value |
Since 0.7.21
void tp_message_set_bytes (TpMessage *self
,guint part
,const gchar *key
,guint len
,gconstpointer bytes
);
Set key
in part part
of self
to have bytes
as a byte-array value.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
|
len |
a number of bytes |
|
bytes |
an array of |
Since 0.7.21
#define tp_message_set_int16(s, p, k, i)
Set key
in part part
of self
to have i
as a signed integer value.
s |
a message |
|
p |
a part number, which must be strictly less than the number
returned by |
|
k |
a key in the mapping representing the part |
|
i |
an integer value |
Since 0.7.21
void tp_message_set_int32 (TpMessage *self
,guint part
,const gchar *key
,gint32 i
);
Set key
in part part
of self
to have i
as a signed integer value.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
|
i |
an integer value |
Since 0.7.21
void tp_message_set_int64 (TpMessage *self
,guint part
,const gchar *key
,gint64 i
);
Set key
in part part
of self
to have i
as a signed integer value.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
|
i |
an integer value |
Since 0.7.21
void tp_message_set_string (TpMessage *self
,guint part
,const gchar *key
,const gchar *s
);
Set key
in part part
of self
to have s
as a string value.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
|
s |
a string value |
Since 0.7.21
void tp_message_set_string_printf (TpMessage *self
,guint part
,const gchar *key
,const gchar *fmt
,...
);
Set key
in part part
of self
to have a string value constructed from a
printf-style format string.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
|
fmt |
a printf-style format string for the string value |
|
... |
arguments for the format string |
Since 0.7.21
#define tp_message_set_uint16(s, p, k, u)
Set key
in part part
of self
to have u
as an unsigned integer value.
s |
a message |
|
p |
a part number, which must be strictly less than the number
returned by |
|
k |
a key in the mapping representing the part |
|
u |
an unsigned integer value |
Since 0.7.21
void tp_message_set_uint32 (TpMessage *self
,guint part
,const gchar *key
,guint32 u
);
Set key
in part part
of self
to have u
as an unsigned integer value.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
|
u |
an unsigned integer value |
Since 0.7.21
void tp_message_set_uint64 (TpMessage *self
,guint part
,const gchar *key
,guint64 u
);
Set key
in part part
of self
to have u
as an unsigned integer value.
self |
a message |
|
part |
a part number, which must be strictly less than the number
returned by |
|
key |
a key in the mapping representing the part |
|
u |
an unsigned integer value |
Since 0.7.21
typedef struct _TpMessage TpMessage;
Opaque structure representing a message in the Telepathy messages interface (an array of at least one mapping from string to variant, where the first mapping contains message headers and subsequent mappings contain the message body).
This base class provides convenience API for most of the common keys that
can appear in the header. One notable exception is the sender of the
message. Inside a connection manager, messages are represented by the
TpCMMessage subclass, and you should use tp_cm_message_get_sender()
.
When composing a message in a client using TpClientMessage, messages do
not have an explicit sender (the sender is automatically the local user).
When a client sees a sent or received message signalled by the connection
manager (represented by TpSignalledMessage), the message's sender (if any)
can be accessed with tp_signalled_message_get_sender()
.