Top | ![]() |
![]() |
![]() |
![]() |
InfUserInfUser — User in a InfSession. |
guint | inf_user_get_id () |
const gchar * | inf_user_get_name () |
InfUserStatus | inf_user_get_status () |
InfUserFlags | inf_user_get_flags () |
InfXmlConnection * | inf_user_get_connection () |
const gchar * | inf_user_status_to_string () |
gboolean | inf_user_status_from_string () |
InfXmlConnection * | connection | Read / Write |
InfUserFlags | flags | Read / Write |
guint | id | Read / Write / Construct Only |
gchar * | name | Read / Write |
InfUserStatus | status | Read / Write |
GEnum ╰── InfUserStatus GFlags ╰── InfUserFlags GObject ╰── InfUser ╰── InfAdoptedUser
InfUser represents a user in an InfSession. The InfUser object stores basic user information required in all kinds of sessions, that is the user ID, user name, its status and auxiliary flags.
const gchar *
inf_user_get_name (InfUser *user
);
Returns the name of the given InfUser.
InfUserStatus
inf_user_get_status (InfUser *user
);
Returns the status of the given InfUser.
InfUserFlags
inf_user_get_flags (InfUser *user
);
Returns the flags for the given InfUser.
InfXmlConnection *
inf_user_get_connection (InfUser *user
);
Returns a connection to the given InfUser, or NULL
. If a non-NULL
connection is returned, then this is the connection through which records
from that user come from. This means that, when this connection is closed,
then the user is no longer available. However, you cannot send something
to this connection expecting the user will receive it. For example,
in central messaging mode, this connection is always the publisher, because
all records from the user are relayed via the publisher.
If this functions returns NULL
, this either means user
is a local user
(INF_USER_LOCAL
flag set) or it is not available (status is
INF_USER_UNAVAILABLE
).
const gchar *
inf_user_status_to_string (InfUserStatus status
);
Returns a non-localized string identifying the given status. This is not meant to be shown to a user, but rather to serialize a user status, for example to store it in XML.
gboolean inf_user_status_from_string (const gchar *string
,InfUserStatus *status
,GError **error
);
This function does the opposite of inf_user_status_to_string()
. It turns
the given string back to a InfUserStatus, storing the result in status
if status
is non-NULL
. If string
is invalid, then status
is left
untouched, error
is set and FALSE
is returned. Otherwise, the function
returns TRUE
.
string |
A string representation of a InfUserStatus. |
|
status |
A pointer to a InfUserStatus value, or |
[out][allow-none] |
error |
Location to store error information, if any. |
struct InfUser;
InfUser is an opaque data type. You should only access it via the public API functions.
struct InfUserClass { void (*set_status)(InfUser* user, InfUserStatus status); };
This structure contains virtual functions for the InfUser class.
“connection”
property“connection” InfXmlConnection *
Connection to the user.
Owner: InfUser
Flags: Read / Write
“flags”
property“flags” InfUserFlags
Flags the user currently has.
Owner: InfUser
Flags: Read / Write
“id”
property “id” guint
A Unique User ID.
Owner: InfUser
Flags: Read / Write / Construct Only
Default value: 0
“name”
property “name” gchar *
The Name with which a user joined a session. Most servers ensure that it is unique.
Owner: InfUser
Flags: Read / Write
Default value: ""
“status”
property“status” InfUserStatus
Whether the user is currently available or not.
Owner: InfUser
Flags: Read / Write
Default value: INF_USER_UNAVAILABLE
“set-status”
signalvoid user_function (InfUser *user, InfUserStatus status, gpointer user_data)
This signal is emitted whenever the user's status changes. This is basically the same as a notification for the “status” property, but it allows to access the previous user status when connecting before the default signal handler.
user |
The InfUser that changes status. |
|
status |
The new user status. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last