30#ifndef _PURPLE_PRPL_H_
31#define _PURPLE_PRPL_H_
65#define NO_BUDDY_ICONS {NULL, 0, 0, 0, 0, 0, 0}
338 void (*set_status)(
PurpleAccount *account, PurpleStatus *status);
342 const char *new_pass);
391 char *(*get_chat_name)(GHashTable *components);
402 const char *message,
const char *who);
418 const char *who,
const char *message);
465 const char *old_group,
const char *new_group);
513 void (*send_file)(
PurpleConnection *,
const char *who,
const char *filename);
540 gboolean (*send_attention)(
PurpleConnection *gc,
const char *username, guint type);
584 PurpleMediaSessionType type);
622 PurpleSetPublicAliasSuccessCallback success_cb,
623 PurpleSetPublicAliasFailureCallback failure_cb);
639 PurpleGetPublicAliasSuccessCallback success_cb,
640 PurpleGetPublicAliasFailureCallback failure_cb);
655 void (*add_buddies_with_invite)(
PurpleConnection *pc, GList *buddies, GList *groups,
const char *message);
696#define PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl, member) \
697 (((G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < G_STRUCT_OFFSET(PurplePluginProtocolInfo, struct_size)) \
698 || (G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < prpl->struct_size)) && \
699 prpl->member != NULL)
702#define PURPLE_IS_PROTOCOL_PLUGIN(plugin) \
703 ((plugin)->info->type == PURPLE_PLUGIN_PROTOCOL)
705#define PURPLE_PLUGIN_PROTOCOL_INFO(plugin) \
706 ((PurplePluginProtocolInfo *)(plugin)->info->extra_info)
731 const char *inc_desc,
const char *out_desc);
871 const char *status_id, ...) G_GNUC_NULL_TERMINATED;
901 gboolean idle, time_t idle_time);
927 const
char *status_id, ...) G_GNUC_NULL_TERMINATED;
939 const
char *status_id);
950 PurpleStatus *old_status,
951 PurpleStatus *new_status);
1026 PurpleMediaSessionType type);
1060#undef PURPLE_PROTOCOL_PLUGIN_HAS_FUNC
1061#define PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl, member) (prpl->member != NULL)
PurpleTypingState
The typing state of a user.
PurpleMessageFlags
Flags applicable to a message.
struct _PurpleStoredImage PurpleStoredImage
A set of utility functions that provide a reference-counted immutable wrapper around an image's data ...
void purple_prpl_got_attention(PurpleConnection *gc, const char *who, guint type_code)
Process an incoming attention message.
PurplePlugin * purple_find_prpl(const char *id)
Finds a protocol plugin structure of the specified type.
const char * purple_attention_type_get_incoming_desc(const PurpleAttentionType *type)
Get the attention type's description shown when the event is received.
void purple_prpl_got_user_status_deactive(PurpleAccount *account, const char *name, const char *status_id)
Notifies libpurple that a buddy's status has been deactivated.
PurpleMediaCaps purple_prpl_get_media_caps(PurpleAccount *account, const char *who)
Determines if the contact supports the given media session type.
const char * purple_attention_type_get_unlocalized_name(const PurpleAttentionType *type)
Get the attention type's unlocalized name; this is useful for some UIs.
PurpleAttentionType * purple_attention_type_new(const char *ulname, const char *name, const char *inc_desc, const char *out_desc)
Creates a new PurpleAttentionType object and sets its mandatory parameters.
void purple_prpl_got_account_login_time(PurpleAccount *account, time_t login_time)
Notifies Purple of our account's log-in time.
gboolean purple_prpl_initiate_media(PurpleAccount *account, const char *who, PurpleMediaSessionType type)
Initiates a media session with the given contact.
@ PURPLE_ICON_SCALE_DISPLAY
We scale the icon when we display it.
@ PURPLE_ICON_SCALE_SEND
We scale the icon before we send it to the server.
const char * purple_attention_type_get_outgoing_desc(const PurpleAttentionType *type)
Get the attention type's description shown when the event is sent.
PurpleProtocolOptions
Protocol options.
@ OPT_PROTO_TRANSIENT_BUDDIES
Indicates that this protocol supports creating invisible buddies for reporting presence/alias of IM p...
@ OPT_PROTO_SLASH_COMMANDS_NATIVE
Indicates that slash commands are native to this protocol.
@ OPT_PROTO_USE_POINTSIZE
Allows font size to be specified in sane point size.
@ OPT_PROTO_NO_PASSWORD
Don't require passwords for sign-in.
@ OPT_PROTO_MAIL_CHECK
Notify on new mail.
@ OPT_PROTO_PASSWORD_OPTIONAL
Allow passwords to be optional.
@ OPT_PROTO_INVITE_MESSAGE
Indicates that this protocol supports sending a user-supplied message along with an invitation.
@ OPT_PROTO_REGISTER_NOSCREENNAME
Set the Register button active even when the username has not been specified.
@ OPT_PROTO_IM_IMAGE
Images in IMs.
@ OPT_PROTO_CHAT_TOPIC
Chat rooms have topics.
@ OPT_PROTO_UNIQUE_CHATNAME
User names are unique to a chat and are not shared between rooms.
void purple_prpl_send_attention(PurpleConnection *gc, const char *who, guint type_code)
Send an attention request message.
GList * purple_prpl_get_statuses(PurpleAccount *account, PurplePresence *presence)
Retrieves the list of stock status types from a prpl.
void purple_prpl_got_user_login_time(PurpleAccount *account, const char *name, time_t login_time)
Notifies Purple of a buddy's log-in time.
void purple_prpl_got_attention_in_chat(PurpleConnection *gc, int id, const char *who, guint type_code)
Process an incoming attention message in a chat.
void purple_prpl_change_account_status(PurpleAccount *account, PurpleStatus *old_status, PurpleStatus *new_status)
Informs the server that our account's status changed.
void purple_attention_type_set_icon_name(PurpleAttentionType *type, const char *name)
Sets the name of the icon to display for the attention event; this is optional.
void purple_prpl_got_user_status(PurpleAccount *account, const char *name, const char *status_id,...) G_GNUC_NULL_TERMINATED
Notifies Purple that a buddy's status has been activated.
void purple_prpl_got_media_caps(PurpleAccount *account, const char *who)
Signals that the prpl received capabilities for the given contact.
struct _PurpleThumbnailSpec PurpleThumbnailSpec
A description of a file transfer thumbnail specification.
void purple_prpl_got_account_status(PurpleAccount *account, const char *status_id,...) G_GNUC_NULL_TERMINATED
Notifies Purple that our account's status has changed.
void purple_attention_type_set_unlocalized_name(PurpleAttentionType *type, const char *ulname)
Sets the unlocalized name of the attention event; some UIs may need this, thus it is required.
void purple_prpl_got_account_idle(PurpleAccount *account, gboolean idle, time_t idle_time)
Notifies Purple that our account's idle state and time have changed.
void purple_prpl_got_account_actions(PurpleAccount *account)
Notifies Purple that our account's actions have changed.
const char * purple_attention_type_get_icon_name(const PurpleAttentionType *type)
Get the attention type's icon name.
void purple_prpl_got_user_idle(PurpleAccount *account, const char *name, gboolean idle, time_t idle_time)
Notifies Purple that a buddy's idle state and time have changed.
void purple_attention_type_set_name(PurpleAttentionType *type, const char *name)
Sets the displayed name of the attention-demanding event.
void purple_attention_type_set_incoming_desc(PurpleAttentionType *type, const char *desc)
Sets the description of the attention-demanding event shown in conversations when the event is receiv...
const char * purple_attention_type_get_name(const PurpleAttentionType *type)
Get the attention type's name as displayed by the UI.
void purple_attention_type_set_outgoing_desc(PurpleAttentionType *type, const char *desc)
Sets the description of the attention-demanding event shown in conversations when the event is sent.
Structure representing an account.
Represents "nudges" and "buzzes" that you may send to a buddy to attract their attention (or vice-ver...
const char * name
Shown in GUI elements.
const char * icon_name
Icon to display (optional)
const char * unlocalized_name
Unlocalized name for UIs needing it.
const char * incoming_description
Shown when sent.
const char * outgoing_description
Shown when receied.
A description of a Buddy Icon specification.
char * format
This is a comma-delimited list of image formats or NULL if icons are not supported.
int max_height
Maximum height of this icon.
int min_height
Minimum height of this icon.
int max_width
Maximum width of this icon
size_t max_filesize
Maximum size in bytes.
PurpleIconScaleRules scale_rules
How to stretch this icon.
int min_width
Minimum width of this icon
A protocol plugin information structure.
void(* get_public_alias)(PurpleConnection *gc, PurpleGetPublicAliasSuccessCallback success_cb, PurpleGetPublicAliasFailureCallback failure_cb)
Retrieve the user's "friendly name" as set on the server.
void(* keepalive)(PurpleConnection *)
If implemented, this will be called regularly for this prpl's active connections.
void(* group_buddy)(PurpleConnection *, const char *who, const char *old_group, const char *new_group)
change a buddy's group on a server list/roster
void(* set_buddy_icon)(PurpleConnection *, PurpleStoredImage *img)
Set the buddy icon for the given connection to img.
void(* unregister_user)(PurpleAccount *, PurpleAccountUnregistrationCb cb, void *user_data)
Remove the user from the server.
int(* send_raw)(PurpleConnection *gc, const char *buf, int len)
For use in plugins that may understand the underlying protocol.
void(* alias_buddy)(PurpleConnection *, const char *who, const char *alias)
save/store buddy's alias on server list/roster
void(* add_buddy)(PurpleConnection *, PurpleBuddy *buddy, PurpleGroup *group)
Add a buddy to a group on the server.
GList * user_splits
A GList of PurpleAccountUserSplit.
void(* chat_invite)(PurpleConnection *, int id, const char *message, const char *who)
Invite a user to join a chat.
void(* chat_leave)(PurpleConnection *, int id)
Called when the user requests leaving a chat.
void(* rename_group)(PurpleConnection *, const char *old_name, PurpleGroup *group, GList *moved_buddies)
rename a group on a server list/roster
int(* chat_send)(PurpleConnection *, int id, const char *message, PurpleMessageFlags flags)
Send a message to a chat.
void(* add_buddy_with_invite)(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group, const char *message)
Add a buddy to a group on the server.
GList * protocol_options
A GList of PurpleAccountOption
void(* reject_chat)(PurpleConnection *, GHashTable *components)
Called when the user refuses a chat invitation.
PurpleBuddyIconSpec icon_spec
The icon spec.
gboolean(* initiate_media)(PurpleAccount *account, const char *who, PurpleMediaSessionType type)
Initiate a media session with the given contact.
void(* join_chat)(PurpleConnection *, GHashTable *components)
Called when the user requests joining a chat.
void(* get_cb_away)(PurpleConnection *, int, const char *who)
void(* close)(PurpleConnection *)
This must be implemented.
void(* get_info)(PurpleConnection *, const char *who)
Should arrange for purple_notify_userinfo() to be called with who's user info.
void(* get_cb_info)(PurpleConnection *, int, const char *who)
gboolean(* offline_message)(const PurpleBuddy *buddy)
Checks whether offline messages to buddy are supported.
void(* set_public_alias)(PurpleConnection *gc, const char *alias, PurpleSetPublicAliasSuccessCallback success_cb, PurpleSetPublicAliasFailureCallback failure_cb)
Set the user's "friendly name" (or alias or nickname or whatever term you want to call it) on the ser...
void(* chat_whisper)(PurpleConnection *, int id, const char *who, const char *message)
Send a whisper to a user in a chat.
void(* login)(PurpleAccount *)
This must be implemented.
int(* send_im)(PurpleConnection *, const char *who, const char *message, PurpleMessageFlags flags)
This PRPL function should return a positive value on success.
PurpleProtocolOptions options
Protocol options.
PurpleMediaCaps(* get_media_caps)(PurpleAccount *account, const char *who)
Checks to see if the given contact supports the given type of media session.
void(* tooltip_text)(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full)
Allows the prpl to add text to a buddy's tooltip.
unsigned int(* send_typing)(PurpleConnection *, const char *name, PurpleTypingState state)
void(* chat_send_file)(PurpleConnection *, int id, const char *filename)
Send a file to a chat room.
unsigned long struct_size
The size of the PurplePluginProtocolInfo.
void(* register_user)(PurpleAccount *)
new user registration
gboolean(* chat_can_receive_file)(PurpleConnection *, int id)
Determine whether a chat can receive a file.
PurpleWhiteboard PRPL Operations.
A core representation of a file transfer.
Represents an entry containing information that must be supplied by the user when joining a chat.
int min
Minimum value in case of integer.
gboolean required
True if it's required.
const char * identifier
Used by the PRPL to identify the option.
const char * label
User-friendly name of the entry.
gboolean secret
True if the entry is secret (password)
int max
Maximum value in case of integer.
gboolean is_int
True if the entry expects an integer.
The PurpleWhiteboard core object.