TelepathyGLib.TextChannel¶
- Subclasses:
 None
Methods¶
- Inherited:
 TelepathyGLib.Channel (44), TelepathyGLib.Proxy (11), GObject.Object (37)
- Structs:
 
class  | 
|
class  | 
|
class  | 
|
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r  | 
The Messages.DeliveryReportingSupport property of the channel  | 
||
r  | 
The SMS.SMSChannel property of the channel  | 
||
r  | 
The Messages.MessagePartSupportFlags property of the channel  | 
||
r  | 
The SMS.Flash property of the channel  | 
||
[  | 
r  | 
The Messages.SupportedContentTypes property of the channel  | 
Signals¶
Name  | 
Short Description  | 
|---|---|
Emitted when a contact’s chat state changes after   | 
|
The   | 
|
The   | 
|
The   | 
Fields¶
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
parent  | 
r  | 
Class Details¶
- class TelepathyGLib.TextChannel(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
Data structure representing a
TelepathyGLib.TextChannel.New in version 0.13.10.
- classmethod new(conn, object_path, immutable_properties)¶
 - Parameters:
 conn (
TelepathyGLib.Connection) – aTelepathyGLib.Connection; may not beNoneobject_path (
str) – the object path of the channel; may not beNoneimmutable_properties ({
str:GObject.Value}) – the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + “.” + property name) toGObject.Valueinstances
- Raises:
 - Returns:
 a newly created
TelepathyGLib.TextChannel- Return type:
 
Convenient function to create a new
TelepathyGLib.TextChannelNew in version 0.13.10.
Deprecated since version ???: Use
TelepathyGLib.SimpleClientFactory.ensure_channel() instead.
- ack_all_pending_messages_async(callback, *user_data)¶
 - Parameters:
 callback (
Gio.AsyncReadyCallbackorNone) – a callback to call when the messages have been acked
Acknowledge all the pending messages. This is equivalent of calling
TelepathyGLib.TextChannel.ack_messages_async() with the list ofTelepathyGLib.SignalledMessagereturned byTelepathyGLib.TextChannel.dup_pending_messages().Once the messages have been acked, callback will be called. You can then call
TelepathyGLib.TextChannel.ack_all_pending_messages_finish() to get the result of the operation.See
TelepathyGLib.TextChannel.ack_message_async() about acknowledging messages.New in version 0.15.3.
- ack_all_pending_messages_finish(result)¶
 - Parameters:
 result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
 - Returns:
 - Return type:
 
Finish an asynchronous acknowledgement operation of all messages.
New in version 0.15.3.
- ack_message_async(message, callback, *user_data)¶
 - Parameters:
 message (
TelepathyGLib.Message) – aTelepathyGLib.SignalledMessagecallback (
Gio.AsyncReadyCallbackorNone) – a callback to call when the message have been acked
Acknowledge message. Once the message has been acked, callback will be called. You can then call
TelepathyGLib.TextChannel.ack_message_finish() to get the result of the operation.A message should be acknowledged once it has been shown to the user by the Handler of the channel. So Observers and Approvers should NOT acknowledge messages themselves. Once a message has been acknowledged, it is removed from the pending-message queue and so the
TelepathyGLib.TextChannel::pending-message-removedsignal is fired.You should use the
TelepathyGLib.SignalledMessagereceived fromTelepathyGLib.TextChannel.dup_pending_messages() or theTelepathyGLib.TextChannel::message-receivedsignal.New in version 0.13.10.
- ack_message_finish(result)¶
 - Parameters:
 result (
Gio.AsyncResult) – aGio.AsyncResultpassed to the callback forTelepathyGLib.TextChannel.ack_message_async()- Raises:
 - Returns:
 - Return type:
 
Finishes acknowledging a message.
New in version 0.13.10.
- ack_messages_async(messages, callback, *user_data)¶
 - Parameters:
 messages ([
TelepathyGLib.SignalledMessage]) – aGLib.ListofTelepathyGLib.SignalledMessagecallback (
Gio.AsyncReadyCallbackorNone) – a callback to call when the message have been acked
Acknowledge all the messages in messages. Once the messages have been acked, callback will be called. You can then call
TelepathyGLib.TextChannel.ack_messages_finish() to get the result of the operation.You should use the
TelepathyGLib.SignalledMessagereceived fromTelepathyGLib.TextChannel.dup_pending_messages() or theTelepathyGLib.TextChannel::message-receivedsignal.See
TelepathyGLib.TextChannel.ack_message_async() about acknowledging messages.New in version 0.13.10.
- ack_messages_finish(result)¶
 - Parameters:
 result (
Gio.AsyncResult) – aGio.AsyncResultpassed to the callback forTelepathyGLib.TextChannel.ack_messages_async()- Raises:
 - Returns:
 - Return type:
 
Finishes acknowledging a list of messages.
New in version 0.13.10.
- dup_pending_messages()¶
 - Returns:
 a
GLib.Listof reffedTelepathyGLib.SignalledMessage- Return type:
 
Return a newly allocated list of unacknowledged
TelepathyGLib.SignalledMessageobjects.It is guaranteed that the
TelepathyGLib.SignalledMessage:senderof eachTelepathyGLib.SignalledMessagehas all of the features previously passed toTelepathyGLib.SimpleClientFactory.add_contact_features() prepared.New in version 0.19.9.
- get_chat_state(contact)¶
 - Parameters:
 contact (
TelepathyGLib.Contact) – aTelepathyGLib.Contact- Returns:
 the chat state for contact, or
TelepathyGLib.ChannelChatState.INACTIVEif their chat state is not known- Return type:
 
Return the chat state for the given contact. If
TelepathyGLib.Proxy.is_prepared() would returnFalsefor the feature %TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, the result will always beTelepathyGLib.ChannelChatState.INACTIVE.New in version 0.19.0.
- get_delivery_reporting_support()¶
 - Returns:
 the value of
TelepathyGLib.TextChannel:delivery-reporting-supportproperty- Return type:
 
Return the
TelepathyGLib.TextChannel:delivery-reporting-supportpropertyNew in version 0.13.10.
- get_message_part_support_flags()¶
 - Returns:
 the value of
TelepathyGLib.TextChannel:message-part-support-flags- Return type:
 
Return the
TelepathyGLib.TextChannel:message-part-support-flagspropertyNew in version 0.13.10.
- get_message_types()¶
 - Returns:
 the value of
TelepathyGLib.TextChannel:message-types- Return type:
 
Return the
TelepathyGLib.TextChannel:message-typespropertyNew in version 0.13.16.
- get_pending_messages()¶
 - Returns:
 a
GLib.Listof borrowedTelepathyGLib.SignalledMessage- Return type:
 
Return a newly allocated list of unacknowledged
TelepathyGLib.SignalledMessageobjects.It is guaranteed that the
TelepathyGLib.SignalledMessage:senderof eachTelepathyGLib.SignalledMessagehas all of the features previously passed toTelepathyGLib.SimpleClientFactory.add_contact_features() prepared.New in version 0.13.10.
Deprecated since version 0.19.9: New code should use
TelepathyGLib.TextChannel.dup_pending_messages() instead.
- get_sms_flash()¶
 - Returns:
 the value of
TelepathyGLib.TextChannel:sms-flashproperty- Return type:
 
Return the
TelepathyGLib.TextChannel:sms-flashpropertyNew in version 0.15.1.
- get_sms_length_async(message, callback, *user_data)¶
 - Parameters:
 message (
TelepathyGLib.Message) – aTelepathyGLib.ClientMessagecallback (
Gio.AsyncReadyCallbackorNone) – a callback to call when the request has been satisfied
Starts an async call to get the number of 140 octet chunks required to send a #message via SMS on #self, as well as the number of remaining characters available in the final chunk and, if possible, an estimate of the cost.
Once the request has been satisfied, callback will be called. You can then call
TelepathyGLib.TextChannel.get_sms_length_finish() to get the result of the operation.New in version 0.15.1.
- get_sms_length_finish(result)¶
 - Parameters:
 result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
 - Returns:
 Trueif the number of 140 octet chunks required to send the message has been retrieved,Falseotherwise.- chunks_required:
 if not
Noneused to return the number of 140 octet chunks required to send the message.- remaining_characters:
 if not
Noneused to return the number of further characters that can be fit in the final chunk. A negative value indicates that the message will be truncated by abs(remaining_characters). The valueGObject.G_MININT32indicates the message will be truncated by an unknown amount.- estimated_cost:
 if not
Noneused to return the estimated cost of sending this message. The currency and scale of this value are the same as the values of theTelepathyGLib.Connection:balance-scaleandTelepathyGLib.Connection:balance-currencyproperties. A value of -1 indicates the cost could not be estimated.
- Return type:
 (
bool, chunks_required:int, remaining_characters:int, estimated_cost:int)
Finishes an async SMS length request.
New in version 0.15.1.
- get_supported_content_types()¶
 - Returns:
 the value of
TelepathyGLib.TextChannel:supported-content-types- Return type:
 [
str]
Return the
TelepathyGLib.TextChannel:supported-content-typespropertyNew in version 0.13.10.
- is_sms_channel()¶
 - Returns:
 the value of
TelepathyGLib.TextChannel:is-sms-channelproperty- Return type:
 
Return the
TelepathyGLib.TextChannel:is-sms-channelpropertyNew in version 0.15.1.
- send_message_async(message, flags, callback, *user_data)¶
 - Parameters:
 message (
TelepathyGLib.Message) – aTelepathyGLib.ClientMessageflags (
TelepathyGLib.MessageSendingFlags) – flags affecting how the message is sentcallback (
Gio.AsyncReadyCallbackorNone) – a callback to call when the message has been submitted to the server
Submit a message to the server for sending. Once the message has been submitted to the sever, callback will be called. You can then call
TelepathyGLib.TextChannel.send_message_finish() to get the result of the operation.New in version 0.13.10.
- send_message_finish(result)¶
 - Parameters:
 result (
Gio.AsyncResult) – aGio.AsyncResultpassed to the callback forTelepathyGLib.TextChannel.send_message_async()- Raises:
 - Returns:
 Trueif the message has been submitted to the server,Falseotherwise.- token:
 if not
None, used to return the token of the sent message
- Return type:
 
Completes a call to
TelepathyGLib.TextChannel.send_message_async().token can be used to match any incoming delivery or failure reports against the sent message. If this function returns true but the returned token is
None, the message was sent successfully but the protocol does not provide a way to identify it later.New in version 0.13.10.
- set_chat_state_async(state, callback, *user_data)¶
 - Parameters:
 state (
TelepathyGLib.ChannelChatState) – aTelepathyGLib.ChannelChatStateto setcallback (
Gio.AsyncReadyCallbackorNone) – a callback to call when the chat state has been set
Set the local state on channel self to state. Once the state has been set, callback will be called. You can then call
TelepathyGLib.TextChannel.set_chat_state_finish() to get the result of the operation.New in version 0.13.10.
- set_chat_state_finish(result)¶
 - Parameters:
 result (
Gio.AsyncResult) – aGio.AsyncResultpassed to the callback forTelepathyGLib.TextChannel.set_chat_state_async()- Raises:
 - Returns:
 - Return type:
 
Completes a call to
TelepathyGLib.TextChannel.set_chat_state_async().New in version 0.13.10.
- supports_message_type(message_type)¶
 - Parameters:
 message_type (
TelepathyGLib.ChannelTextMessageType) – aTelepathyGLib.ChannelTextMessageType- Returns:
 Trueif message of type message_type can be sent on self,Falseotherwise- Return type:
 
Check if message of type message_type can be sent on this channel.
New in version 0.13.16.
Signal Details¶
- TelepathyGLib.TextChannel.signals.contact_chat_state_changed(text_channel, contact, state)¶
 - Signal Name:
 contact-chat-state-changed- Flags:
 - Parameters:
 text_channel (
TelepathyGLib.TextChannel) – The object which received the signalcontact (
TelepathyGLib.Contact) – aTelepathyGLib.Contactfor the local user or another contactstate (
int) – the newTelepathyGLib.ChannelChatStatefor the contact
Emitted when a contact’s chat state changes after
TelepathyGLib.Proxy.prepare_async() has finished preparing features %TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, %TP_CHANNEL_FEATURE_GROUP and %TP_CHANNEL_FEATURE_CONTACTS.New in version 0.19.0.
- TelepathyGLib.TextChannel.signals.message_received(text_channel, message)¶
 - Signal Name:
 message-received- Flags:
 - Parameters:
 text_channel (
TelepathyGLib.TextChannel) – The object which received the signalmessage (
TelepathyGLib.SignalledMessage) – aTelepathyGLib.SignalledMessage
The
::message-receivedsignal is emitted when a new message has been received on self.The same message object will be used by the
TelepathyGLib.TextChannel::pending-message-removedsignal once message has been acked so you can simply compare pointers to identify the message.Note that this signal is only fired once the #TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared.
It is guaranteed that message's
TelepathyGLib.SignalledMessage:senderhas all of the features previously passed toTelepathyGLib.SimpleClientFactory.add_contact_features() prepared.New in version 0.13.10.
- TelepathyGLib.TextChannel.signals.message_sent(text_channel, message, flags, token)¶
 - Signal Name:
 message-sent- Flags:
 - Parameters:
 text_channel (
TelepathyGLib.TextChannel) – The object which received the signalmessage (
TelepathyGLib.SignalledMessage) – aTelepathyGLib.SignalledMessageflags (
int) – theTelepathyGLib.MessageSendingFlagsaffecting how the message was senttoken (
str) – an opaque token used to match any incoming delivery or failure reports against this message, orNoneif the message is not readily identifiable.
The
::message-sentsignal is emitted when message has been submitted for sending.It is guaranteed that message's
TelepathyGLib.SignalledMessage:senderhas all of the features previously passed toTelepathyGLib.SimpleClientFactory.add_contact_features() prepared.New in version 0.13.10.
- TelepathyGLib.TextChannel.signals.pending_message_removed(text_channel, message)¶
 - Signal Name:
 pending-message-removed- Flags:
 - Parameters:
 text_channel (
TelepathyGLib.TextChannel) – The object which received the signalmessage (
TelepathyGLib.SignalledMessage) – aTelepathyGLib.SignalledMessage
The
::pending-message-removedsignal is emitted when message has been acked and so removed from the pending messages list.Note that this signal is only fired once the #TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared.
It is guaranteed that message's
TelepathyGLib.SignalledMessage:senderhas all of the features previously passed toTelepathyGLib.SimpleClientFactory.add_contact_features() prepared.New in version 0.13.10.
Property Details¶
- TelepathyGLib.TextChannel.props.delivery_reporting_support¶
 - 
A
TelepathyGLib.DeliveryReportingSupportFlagsindicating features supported by this channel.New in version 0.13.10.
 
- TelepathyGLib.TextChannel.props.is_sms_channel¶
 - 
Trueif messages sent and received on this channel are transmitted via SMS.This property is not guaranteed to have a meaningful value until TP_TEXT_CHANNEL_FEATURE_SMS has been prepared.
New in version 0.15.1.
 
- TelepathyGLib.TextChannel.props.message_part_support_flags¶
 - 
A
TelepathyGLib.MessagePartSupportFlagsindicating the level of support for message parts on this channel.New in version 0.13.10.
 
- TelepathyGLib.TextChannel.props.sms_flash¶
 - 
Trueif this channel is exclusively for receiving class 0 SMSes (and no SMSes can be sent usingTelepathyGLib.TextChannel.send_message_async() on this channel). IfFalse, no incoming class 0 SMSes will appear on this channel.New in version 0.15.1.