libpurple/prpl.c

branch
vv
changeset 26337
ec2fc1bc9024
parent 25888
d0fdd378a635
parent 26316
950c0d491c0d
child 26482
72d16a73cf12
equal deleted inserted replaced
26044:133e5eca834c 26337:ec2fc1bc9024
494 purple_prpl_got_attention_in_chat(PurpleConnection *gc, int id, const char *who, guint type_code) 494 purple_prpl_got_attention_in_chat(PurpleConnection *gc, int id, const char *who, guint type_code)
495 { 495 {
496 got_attention(gc, id, who, type_code); 496 got_attention(gc, id, who, type_code);
497 } 497 }
498 498
499 PurpleMedia *
500 purple_prpl_initiate_media(PurpleAccount *account,
501 const char *who,
502 PurpleMediaSessionType type)
503 {
504 #ifdef USE_VV
505 PurpleConnection *gc = NULL;
506 PurplePlugin *prpl = NULL;
507 PurplePluginProtocolInfo *prpl_info = NULL;
508
509 if (account)
510 gc = purple_account_get_connection(account);
511 if (gc)
512 prpl = purple_connection_get_prpl(gc);
513 if (prpl)
514 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
515
516 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, initiate_media)) {
517 /* should check that the protocol supports this media type here? */
518 return prpl_info->initiate_media(gc, who, type);
519 } else {
520 return NULL;
521 }
522 #else
523 return NULL;
524 #endif
525 }
526
527 PurpleMediaCaps
528 purple_prpl_get_media_caps(PurpleAccount *account, const char *who)
529 {
530 #ifdef USE_VV
531 PurpleConnection *gc = NULL;
532 PurplePlugin *prpl = NULL;
533 PurplePluginProtocolInfo *prpl_info = NULL;
534
535 if (account)
536 gc = purple_account_get_connection(account);
537 if (gc)
538 prpl = purple_connection_get_prpl(gc);
539 if (prpl)
540 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
541
542 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info,
543 get_media_caps)) {
544 return prpl_info->get_media_caps(gc, who);
545 }
546 #endif
547 return PURPLE_MEDIA_CAPS_NONE;
548 }
549
499 /************************************************************************** 550 /**************************************************************************
500 * Protocol Plugin Subsystem API 551 * Protocol Plugin Subsystem API
501 **************************************************************************/ 552 **************************************************************************/
502 553
503 PurplePlugin * 554 PurplePlugin *
515 return plugin; 566 return plugin;
516 } 567 }
517 568
518 return NULL; 569 return NULL;
519 } 570 }
571

mercurial