comparison libpurple/prpl.h @ 23868:1aa383ee5fc8

Fixed up media functions in prpl.c and prpl.h, adding more documentation and using PURPLE_PROTOCOL_PLUGIN_HAS_FUNC.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 09 Aug 2008 03:11:46 +0000
parents 4bc74deeb503
children 551a462b346a
comparison
equal deleted inserted replaced
23867:4bc74deeb503 23868:1aa383ee5fc8
439 * @return The protocol's string hash table. The hash table should be 439 * @return The protocol's string hash table. The hash table should be
440 * destroyed by the caller when it's no longer needed. 440 * destroyed by the caller when it's no longer needed.
441 */ 441 */
442 GHashTable *(*get_account_text_table)(PurpleAccount *account); 442 GHashTable *(*get_account_text_table)(PurpleAccount *account);
443 443
444 /** Initiate media with the given buddy */ 444 /**
445 PurpleMedia *(*initiate_media)(PurpleConnection *conn, const char *who, PurpleMediaStreamType type); 445 * Initiate a media session with the given contact.
446 446 *
447 gboolean (*can_do_media)(PurpleConnection *conn, const char *who, PurpleMediaStreamType type); 447 * @param conn The connection to initiate the media session on.
448 * @param who The remote user to initiate the session with.
449 * @param type The type of media session to initiate.
450 * @return The newly created media object.
451 */
452 PurpleMedia *(*initiate_media)(PurpleConnection *gc, const char *who,
453 PurpleMediaStreamType type);
454
455 /**
456 * Checks to see if the given contact supports the given type of media session.
457 *
458 * @param conn The connection the contact is on.
459 * @param who The remote user to check for media capability with.
460 * @param type The type of media session to check for.
461 * @return @c TRUE The contact supports the given media type, or @c FALSE otherwise.
462 */
463 gboolean (*can_do_media)(PurpleConnection *gc, const char *who,
464 PurpleMediaStreamType type);
448 }; 465 };
449 466
450 #define PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl, member) \ 467 #define PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl, member) \
451 (((G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < G_STRUCT_OFFSET(PurplePluginProtocolInfo, struct_size)) \ 468 (((G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < G_STRUCT_OFFSET(PurplePluginProtocolInfo, struct_size)) \
452 || (G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < prpl->struct_size)) && \ 469 || (G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < prpl->struct_size)) && \