pidgin 2.14.14dev
Loading...
Searching...
No Matches
server.h File Reference

Server API. More...

#include "account.h"
#include "conversation.h"
#include "prpl.h"
Include dependency graph for server.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

unsigned int serv_send_typing (PurpleConnection *gc, const char *name, PurpleTypingState state)
 Send a typing message to a given user over a given connection.
 
void serv_move_buddy (PurpleBuddy *, PurpleGroup *, PurpleGroup *)
 
int serv_send_im (PurpleConnection *, const char *, const char *, PurpleMessageFlags flags)
 
PurpleAttentionTypepurple_get_attention_type_from_code (PurpleAccount *account, guint type_code)
 Get information about an account's attention commands, from the prpl.
 
void serv_send_attention (PurpleConnection *gc, const char *who, guint type_code)
 Send an attention request message.
 
void serv_got_attention (PurpleConnection *gc, const char *who, guint type_code)
 Process an incoming attention message.
 
void serv_get_info (PurpleConnection *, const char *)
 
void serv_set_info (PurpleConnection *, const char *)
 
void serv_add_permit (PurpleConnection *, const char *)
 
void serv_add_deny (PurpleConnection *, const char *)
 
void serv_rem_permit (PurpleConnection *, const char *)
 
void serv_rem_deny (PurpleConnection *, const char *)
 
void serv_set_permit_deny (PurpleConnection *)
 
void serv_chat_invite (PurpleConnection *, int, const char *, const char *)
 
void serv_chat_leave (PurpleConnection *, int)
 
void serv_chat_whisper (PurpleConnection *, int, const char *, const char *)
 
int serv_chat_send (PurpleConnection *, int, const char *, PurpleMessageFlags flags)
 
void serv_alias_buddy (PurpleBuddy *)
 
void serv_got_alias (PurpleConnection *gc, const char *who, const char *alias)
 
void purple_serv_got_private_alias (PurpleConnection *gc, const char *who, const char *alias)
 A protocol plugin should call this when it retrieves a private alias from the server.
 
void serv_got_typing (PurpleConnection *gc, const char *name, int timeout, PurpleTypingState state)
 Receive a typing message from a remote user.
 
void serv_got_typing_stopped (PurpleConnection *gc, const char *name)
 TODO: Could probably move this into the conversation API.
 
void serv_got_im (PurpleConnection *gc, const char *who, const char *msg, PurpleMessageFlags flags, time_t mtime)
 
void serv_join_chat (PurpleConnection *, GHashTable *data)
 
void serv_reject_chat (PurpleConnection *, GHashTable *data)
 
void serv_got_chat_invite (PurpleConnection *gc, const char *name, const char *who, const char *message, GHashTable *data)
 Called by a prpl when an account is invited into a chat.
 
PurpleConversationserv_got_joined_chat (PurpleConnection *gc, int id, const char *name)
 Called by a prpl when an account has joined a chat.
 
void purple_serv_got_join_chat_failed (PurpleConnection *gc, GHashTable *data)
 Called by a prpl when an attempt to join a chat via serv_join_chat() fails.
 
void serv_got_chat_left (PurpleConnection *g, int id)
 Called by a prpl when an account has left a chat.
 
void serv_got_chat_in (PurpleConnection *g, int id, const char *who, PurpleMessageFlags flags, const char *message, time_t mtime)
 Called by a prpl when a message has been received in a chat.
 
void serv_send_file (PurpleConnection *gc, const char *who, const char *file)
 
void serv_chat_send_file (PurpleConnection *gc, int id, const char *file)
 

Detailed Description

Server API.

Definition in file server.h.

Function Documentation

◆ purple_get_attention_type_from_code()

PurpleAttentionType * purple_get_attention_type_from_code ( PurpleAccount account,
guint  type_code 
)

Get information about an account's attention commands, from the prpl.

Returns
The attention command numbered 'code' from the prpl's attention_types, or NULL.

◆ purple_serv_got_join_chat_failed()

void purple_serv_got_join_chat_failed ( PurpleConnection gc,
GHashTable *  data 
)

Called by a prpl when an attempt to join a chat via serv_join_chat() fails.

Parameters
gcThe connection on which chat joining failed
dataThe components passed to serv_join_chat() originally. The hash function should be g_str_hash() and the equal function should be g_str_equal().

◆ purple_serv_got_private_alias()

void purple_serv_got_private_alias ( PurpleConnection gc,
const char *  who,
const char *  alias 
)

A protocol plugin should call this when it retrieves a private alias from the server.

Private aliases are the aliases the user sets, while public aliases are the aliases or display names that buddies set for themselves.

Parameters
gcThe connection on which the alias was received.
whoThe name of the buddy whose alias was received.
aliasThe alias that was received.

◆ serv_got_attention()

void serv_got_attention ( PurpleConnection gc,
const char *  who,
guint  type_code 
)

Process an incoming attention message.

Deprecated:
Use purple_prpl_got_attention() instead.
Parameters
gcThe connection that received the attention message.
whoWho requested your attention.
type_codeAn index into the prpl's attention_types list determining the type of the attention request command to send.

◆ serv_got_chat_in()

void serv_got_chat_in ( PurpleConnection g,
int  id,
const char *  who,
PurpleMessageFlags  flags,
const char *  message,
time_t  mtime 
)

Called by a prpl when a message has been received in a chat.

Parameters
gThe connection on which the message was received.
idThe id of the chat, as assigned by the prpl.
whoThe name of the user who sent the message.
flagsThe flags of the message.
messageThe message received in the chat.
mtimeThe time when the message was received.

◆ serv_got_chat_invite()

void serv_got_chat_invite ( PurpleConnection gc,
const char *  name,
const char *  who,
const char *  message,
GHashTable *  data 
)

Called by a prpl when an account is invited into a chat.

Parameters
gcThe connection on which the invite arrived.
nameThe name of the chat you're being invited to.
whoThe username of the person inviting the account.
messageThe optional invite message.
dataThe components necessary if you want to call serv_join_chat(). The hash function should be g_str_hash() and the equal function should be g_str_equal().

◆ serv_got_chat_left()

void serv_got_chat_left ( PurpleConnection g,
int  id 
)

Called by a prpl when an account has left a chat.

Parameters
gThe connection on which the chat was left.
idThe id of the chat, as assigned by the prpl.

◆ serv_got_joined_chat()

PurpleConversation * serv_got_joined_chat ( PurpleConnection gc,
int  id,
const char *  name 
)

Called by a prpl when an account has joined a chat.

Parameters
gcThe connection on which the chat was joined.
idThe id of the chat, assigned by the prpl.
nameThe name of the chat.
Returns
The resulting conversation

◆ serv_got_typing()

void serv_got_typing ( PurpleConnection gc,
const char *  name,
int  timeout,
PurpleTypingState  state 
)

Receive a typing message from a remote user.

Either PURPLE_TYPING or PURPLE_TYPED. If the user has stopped typing then use serv_got_typing_stopped instead.

TODO: Could probably move this into the conversation API.

Parameters
gcThe connection on which the typing message was received.
nameThe name of the remote user.
timeoutIf this is a number greater than 0, then Purple will wait this number of seconds and then set this buddy to the PURPLE_NOT_TYPING state. This is used by protocols that send repeated typing messages while the user is composing the message.
stateThe typing state received

◆ serv_join_chat()

void serv_join_chat ( PurpleConnection ,
GHashTable *  data 
)
Parameters
dataThe hash function should be g_str_hash() and the equal function should be g_str_equal().

◆ serv_reject_chat()

void serv_reject_chat ( PurpleConnection ,
GHashTable *  data 
)
Parameters
dataThe hash function should be g_str_hash() and the equal function should be g_str_equal().

◆ serv_send_attention()

void serv_send_attention ( PurpleConnection gc,
const char *  who,
guint  type_code 
)

Send an attention request message.

Deprecated:
Use purple_prpl_send_attention() instead.
Parameters
gcThe connection to send the message on.
whoWhose attention to request.
type_codeAn index into the prpl's attention_types list determining the type of the attention request command to send. 0 if prpl only defines one, but protocols are allowed to define more.

Note that you can't send arbitrary PurpleAttentionType's, because there is only a fixed set of attention commands.

◆ serv_send_typing()

unsigned int serv_send_typing ( PurpleConnection gc,
const char *  name,
PurpleTypingState  state 
)

Send a typing message to a given user over a given connection.

TODO: Could probably move this into the conversation API.

Parameters
gcThe connection over which to send the typing notification.
nameThe user to send the typing notification to.
stateOne of PURPLE_TYPING, PURPLE_TYPED, or PURPLE_NOT_TYPING.
Returns
A quiet-period, specified in seconds, where Purple will not send any additional typing notification messages. Most protocols should return 0, which means that no additional PURPLE_TYPING messages need to be sent. If this is 5, for example, then Purple will wait five seconds, and if the Purple user is still typing then Purple will send another PURPLE_TYPING message.