comparison libpurple/prpl.h @ 18916:0f46f13c0805

Proposed "attention" API, a generalization of zaps (MySpaceIM), buzzes (Yahoo), and nudges (MSN). Adds a PurpleAttentionType struct to prpl.h, which is used to describe the the attention command (some protocols, notably MySpaceIM, support more than one). Uses two reserved fields in PurplePluginProtocolInfo, one function for sending an attention command, another for getting the possible attention commands (similar to status_types). Adds serv_got_attention() to server.c, similar to serv_got_im(), used to notify of incoming or outgoing attention notices.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Mon, 13 Aug 2007 05:59:24 +0000
parents 72906c5ac037
children 6ea5602643ea
comparison
equal deleted inserted replaced
18915:bfc52862d864 18916:0f46f13c0805
88 gboolean is_int; 88 gboolean is_int;
89 int min; 89 int min;
90 int max; 90 int max;
91 gboolean secret; 91 gboolean secret;
92 }; 92 };
93
94 typedef struct _PurpleAttentionType PurpleAttentionType;
95
96 /** A type of "attention" message (zap, nudge, buzz, etc. depending on the
97 * protocol) that can be sent and received. */
98 struct _PurpleAttentionType {
99 PurpleStoredImage *icon;
100 const gchar *description; /**< Shown before sending. */
101 const gchar *incoming_description; /**< Shown when sent. */
102 const gchar *outgoing_description; /**< Shown when received. */
103 };
104
93 105
94 /** 106 /**
95 * Protocol options 107 * Protocol options
96 * 108 *
97 * These should all be stuff that some plugins can do and others can't. 109 * These should all be stuff that some plugins can do and others can't.
322 int (*send_raw)(PurpleConnection *gc, const char *buf, int len); 334 int (*send_raw)(PurpleConnection *gc, const char *buf, int len);
323 335
324 /* room list serialize */ 336 /* room list serialize */
325 char *(*roomlist_room_serialize)(PurpleRoomlistRoom *room); 337 char *(*roomlist_room_serialize)(PurpleRoomlistRoom *room);
326 338
327 void (*_purple_reserved1)(void); 339 /* Attention API, for sending zaps/nudges/buzzes */
328 void (*_purple_reserved2)(void); 340 gboolean (*send_attention)(PurpleConnection *gc, gchar *username, guint type);
341 GList *(*attention_types)(PurpleAccount *acct);
342
329 void (*_purple_reserved3)(void); 343 void (*_purple_reserved3)(void);
330 void (*_purple_reserved4)(void); 344 void (*_purple_reserved4)(void);
331 }; 345 };
332 346
333 #define PURPLE_IS_PROTOCOL_PLUGIN(plugin) \ 347 #define PURPLE_IS_PROTOCOL_PLUGIN(plugin) \