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.ChatSessionis an opaque data type. You should only access it via the public API functions.- 
classmethod new(manager, buffer, status, sync_group, sync_connection)¶
- Parameters: - manager (Infinity.CommunicationManager) – AInfinity.CommunicationManager.
- buffer (Infinity.ChatBuffer) – TheInfinity.ChatBufferto use for the session.
- status (Infinity.SessionStatus) – Initial status of the session. If this isInfinity.SessionStatus.SYNCHRONIZINGorInfinity.SessionStatus.PRESYNC, then sync_group and sync_connection need to be set.
- sync_group (Infinity.CommunicationGroup) – A group in which the session is synchronized. Ignored if status isInfinity.SessionStatus.RUNNING.
- sync_connection (Infinity.XmlConnection) – A connection to synchronize the session from. Ignored if status isInfinity.SessionStatus.RUNNING.
 - Returns: - A new - Infinity.ChatSession.- Return type: - Creates a new - Infinity.ChatSessionwith 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.PRESYNCor- Infinity.SessionStatus.SYNCHRONIZING, then the session will initially be synchronized, meaning an initial backlog is retrieved from sync_connection (which must not be- Nonein this case). If you are subscribed to the session, set the subscription group via- Infinity.Session.set_subscription_group().
- manager (
 - 
set_log_file(log_file)¶
- Parameters: - log_file ( - str) – A filename to store all received messages into.- Raises: - GLib.Error- Returns: - Trueif the log file could be opened,- Falseotherwise (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) –
 
- 
classmethod 
Signal Details¶
- 
Infinity.ChatSession.signals.receive_message(chat_session, message)¶
- Signal Name: - receive-message- Flags: - Parameters: - chat_session (Infinity.ChatSession) – The object which received the signal
- message (Infinity.ChatBufferMessage) – TheInfinity.ChatBufferMessagethat was received.
 - This signal is emitted whenever a message has been received. If the session is in - Infinity.SessionStatus.SYNCHRONIZINGstate the received message was a backlog message.
- chat_session (
- 
Infinity.ChatSession.signals.send_message(chat_session, message)¶
- Signal Name: - send-message- Flags: - Parameters: - chat_session (Infinity.ChatSession) – The object which received the signal
- message (Infinity.ChatBufferMessage) – TheInfinity.ChatBufferMessagethat is sent.
 - 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.USERJOINor- Infinity.ChatBufferMessageType.USERPARTcan not be sent explicitely, so this signal will never be emitted for such messages.
- chat_session (