Infinity.ChatSession¶
- Subclasses:
 None
Methods¶
- Inherited:
 Infinity.Session (19), GObject.Object (37), Infinity.CommunicationObject (3)
- Structs:
 
class  | 
  | 
  | 
Virtual Methods¶
  | 
|
  | 
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w  | 
The file into which to store all received messages  | 
Signals¶
- Inherited:
 
Name  | 
Short Description  | 
|---|---|
This signal is emitted whenever a message has been received.  | 
|
This signal is emitted whenever a message is sent.  | 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
parent  | 
r  | 
Class Details¶
- class Infinity.ChatSession(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
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.PRESYNCorInfinity.SessionStatus.SYNCHRONIZING, then the session will initially be synchronized, meaning an initial backlog is retrieved from sync_connection (which must not beNonein this case). If you are subscribed to the session, set the subscription group viaInfinity.Session.set_subscription_group().
- set_log_file(log_file)¶
 - Parameters:
 log_file (
str) – A filename to store all received messages into.- Raises:
 - Returns:
 Trueif the log file could be opened,Falseotherwise (in which case error is set).- Return type:
 
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) –
Default signal handler for the
Infinity.ChatSession::receive-messagesignal.
- do_send_message(message) virtual¶
 - Parameters:
 message (
Infinity.ChatBufferMessage) –
Default signal handler for the
Infinity.ChatSession::send-messagesignal.
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 signalmessage (
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.
- Infinity.ChatSession.signals.send_message(chat_session, message)¶
 - Signal Name:
 send-message- Flags:
 - Parameters:
 chat_session (
Infinity.ChatSession) – The object which received the signalmessage (
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() orInfinity.ChatBuffer.add_emote_message() on the session’sInfinity.ChatBuffer. Messages of typeInfinity.ChatBufferMessageType.USERJOINorInfinity.ChatBufferMessageType.USERPARTcan not be sent explicitely, so this signal will never be emitted for such messages.