TelepathyGLib.PresenceStatusSpec

Fields

Name

Type

Access

Description

name

str

r/w

String identifier of the presence status

optional_arguments

TelepathyGLib.PresenceStatusOptionalArgumentSpec

r/w

An array of TelepathyGLib.PresenceStatusOptionalArgumentSpec structures representing the optional arguments for this status, terminated by a None name. If there are no optional arguments for a status, this can be None. In modern Telepathy connection managers, the only optional argument should be a string (type “s”) named “message” on statuses that have an optional human-readable message. All other optional arguments are deprecated.

presence_type

TelepathyGLib.ConnectionPresenceType

r/w

A type value, as specified by TelepathyGLib.ConnectionPresenceType

self

bool

r/w

Indicates if this status may be set on yourself

Methods

class

new (name, type, can_set_on_self, has_message)

can_set_on_self ()

copy ()

free ()

get_name ()

get_presence_type ()

has_message ()

Details

class TelepathyGLib.PresenceStatusSpec

Structure specifying a supported presence status.

In addition to the fields documented here, there are two object fields which must currently be None. A meaning may be defined for these in a future version of telepathy-glib.

classmethod new(name, type, can_set_on_self, has_message)
Parameters:
  • name (str) – the name of the new presence status

  • type (TelepathyGLib.ConnectionPresenceType) – the category into which this presence status falls

  • can_set_on_self (bool) – True if the user can set this presence status on themselves

  • has_message (bool) – True if this presence status is accompanied by an optional human-readable message

Returns:

a new TelepathyGLib.PresenceStatusSpec

Return type:

TelepathyGLib.PresenceStatusSpec

New in version 0.23.1.

can_set_on_self()
Returns:

True if the user can set this presence status on themselves (most statuses), or False if they cannot directly set it on themselves (typically used for TelepathyGLib.ConnectionPresenceType.OFFLINE and TelepathyGLib.ConnectionPresenceType.ERROR)

Return type:

bool

New in version 0.23.1.

copy()
Returns:

a new TelepathyGLib.PresenceStatusSpec resembling self

Return type:

TelepathyGLib.PresenceStatusSpec

Copy a presence status specification.

If self has optional arguments other than a string named “message”, they are not copied. Optional arguments with other names or types are deprecated.

New in version 0.23.1.

free()

Free a presence status specification produced by TelepathyGLib.PresenceStatusSpec.new() or TelepathyGLib.PresenceStatusSpec.copy().

New in version 0.23.1.

get_name()
Returns:

the name of this presence status, such as “available” or “out-to-lunch”.

Return type:

str

New in version 0.23.1.

get_presence_type()
Returns:

a TelepathyGLib.ConnectionPresenceType

Return type:

TelepathyGLib.ConnectionPresenceType

Return the category into which this presence type falls. For instance, for XMPP’s “” (do not disturb) status, this would return TelepathyGLib.ConnectionPresenceType.BUSY.

New in version 0.23.1.

has_message()
Returns:

True if this presence status is accompanied by an optional human-readable message

Return type:

bool

New in version 0.23.1.