Infinity.ChatBuffer

g GObject.GInterface GObject.GInterface Infinity.Buffer Infinity.Buffer GObject.GInterface->Infinity.Buffer GObject.Object GObject.Object Infinity.ChatBuffer Infinity.ChatBuffer GObject.Object->Infinity.ChatBuffer Infinity.Buffer->Infinity.ChatBuffer

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Infinity.Buffer (2)

Structs:

GObject.ObjectClass (5)

class

new (size)

add_emote_message (by, message, time, flags)

add_message (by, message, time, flags)

add_userjoin_message (user, time, flags)

add_userpart_message (user, time, flags)

get_message (n)

get_n_messages ()

get_size ()

Virtual Methods

Inherited:

GObject.Object (7), Infinity.Buffer (2)

do_add_message (message)

Properties

Inherited:

Infinity.Buffer (1)

Name

Type

Flags

Short Description

size

int

r/w/co

The maxmimum number of messages saved

Signals

Inherited:

GObject.Object (1)

Name

Short Description

add-message

This signal is emitted whenever a message has been added to buffer.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Infinity.ChatBuffer(**kwargs)
Bases:

GObject.Object, Infinity.Buffer

Abstract:

No

Structure:

Infinity.ChatBufferClass

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

classmethod new(size)
Parameters:

size (int) – The number of messages to store.

Returns:

A new Infinity.ChatBuffer.

Return type:

Infinity.ChatBuffer

Creates a new Infinity.ChatBuffer which contains no initial messages. size specifies how many messages to store before dropping old messages.

add_emote_message(by, message, time, flags)
Parameters:

Adds a new emote message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.

add_message(by, message, time, flags)
Parameters:

Adds a new message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.

add_userjoin_message(user, time, flags)
Parameters:

Adds a new userjoin message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.

add_userpart_message(user, time, flags)
Parameters:

Adds a new userpart message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.

get_message(n)
Parameters:

n (int) – The index of the message to obtain.

Returns:

The Infinity.ChatBufferMessage with the given index.

Return type:

Infinity.ChatBufferMessage

Returns the message with the given index from the buffer. The oldest message in the buffer has index 0, and the most recent one has index Infinity.ChatBuffer.get_n_messages() - 1.

get_n_messages()
Returns:

The number of messages in the buffer.

Return type:

int

Returns the number of messages in the buffer.

get_size()
Returns:

The number of messages in the chat buffer.

Return type:

int

Returns the size of the chat buffer, which is the maximum number of messages that can be stored in the buffer.

do_add_message(message) virtual
Parameters:

message (Infinity.ChatBufferMessage) –

Signal Details

Infinity.ChatBuffer.signals.add_message(chat_buffer, message)
Signal Name:

add-message

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a message has been added to buffer.

Property Details

Infinity.ChatBuffer.props.size
Name:

size

Type:

int

Default Value:

256

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The maxmimum number of messages saved