Infinity.ChatSession

g GObject.GInterface GObject.GInterface Infinity.CommunicationObject Infinity.CommunicationObject GObject.GInterface->Infinity.CommunicationObject GObject.Object GObject.Object Infinity.Session Infinity.Session GObject.Object->Infinity.Session Infinity.ChatSession Infinity.ChatSession Infinity.CommunicationObject->Infinity.Session Infinity.Session->Infinity.ChatSession

Subclasses:

None

Methods

Inherited:

Infinity.Session (19), GObject.Object (37), Infinity.CommunicationObject (3)

Structs:

GObject.ObjectClass (5)

class

new (manager, buffer, status, sync_group, sync_connection)

set_log_file (log_file)

Virtual Methods

Inherited:

Infinity.Session (11), GObject.Object (7), Infinity.CommunicationObject (3)

do_receive_message (message)

do_send_message (message)

Properties

Inherited:

Infinity.Session (7)

Name

Type

Flags

Short Description

log-file

str

r/w

The file into which to store all received messages

Signals

Inherited:

Infinity.Session (6), GObject.Object (1)

Name

Short Description

receive-message

This signal is emitted whenever a message has been received.

send-message

This signal is emitted whenever a message is sent.

Fields

Inherited:

Infinity.Session (6), GObject.Object (1)

Name

Type

Access

Description

parent

Infinity.Session

r

Class Details

class Infinity.ChatSession(**kwargs)
Bases:

Infinity.Session

Abstract:

No

Structure:

Infinity.ChatSessionClass

Infinity.ChatSession is an opaque data type. You should only access it via the public API functions.

classmethod new(manager, buffer, status, sync_group, sync_connection)
Parameters:
Returns:

A new Infinity.ChatSession.

Return type:

Infinity.ChatSession

Creates a new Infinity.ChatSession with the messages contained in buffer as initial messages. The communication manager is used to send and receive requests from subscription and synchronization.

If status is Infinity.SessionStatus.PRESYNC or Infinity.SessionStatus.SYNCHRONIZING, then the session will initially be synchronized, meaning an initial backlog is retrieved from sync_connection (which must not be None in this case). If you are subscribed to the session, set the subscription group via Infinity.Session.set_subscription_group().

set_log_file(log_file)
Parameters:

log_file (str) – A filename to store all received messages into.

Raises:

GLib.Error

Returns:

True if the log file could be opened, False otherwise (in which case error is set).

Return type:

bool

Sets a file onto which all received messages are appended. The file is created if it does not exist. If a previous log file was set, then it is closed before opening the new file.

Backlog messages received upon synchronization are not logged.

do_receive_message(message) virtual
Parameters:

message (Infinity.ChatBufferMessage) –

do_send_message(message) virtual
Parameters:

message (Infinity.ChatBufferMessage) –

Signal Details

Infinity.ChatSession.signals.receive_message(chat_session, message)
Signal Name:

receive-message

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a message has been received. If the session is in Infinity.SessionStatus.SYNCHRONIZING state the received message was a backlog message.

Infinity.ChatSession.signals.send_message(chat_session, message)
Signal Name:

send-message

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a message is sent. Messages can be sent by calling Infinity.ChatBuffer.add_message() or Infinity.ChatBuffer.add_emote_message() on the session’s Infinity.ChatBuffer. Messages of type Infinity.ChatBufferMessageType.USERJOIN or Infinity.ChatBufferMessageType.USERPART can not be sent explicitely, so this signal will never be emitted for such messages.

Property Details

Infinity.ChatSession.props.log_file
Name:

log-file

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The file into which to store all received messages