Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jabber.c @ 26447:34eb898478b4
Don't assume a PurpleMedia instance will be created immediately.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Sat, 28 Mar 2009 00:58:02 +0000 |
parents | d06236d07c9e |
children | da651b0f40a1 |
comparison
equal
deleted
inserted
replaced
26446:e114ed3c8cfe | 26447:34eb898478b4 |
---|---|
2610 gboolean jabber_offline_message(const PurpleBuddy *buddy) | 2610 gboolean jabber_offline_message(const PurpleBuddy *buddy) |
2611 { | 2611 { |
2612 return TRUE; | 2612 return TRUE; |
2613 } | 2613 } |
2614 | 2614 |
2615 PurpleMedia * | 2615 gboolean |
2616 jabber_initiate_media(PurpleConnection *gc, const char *who, | 2616 jabber_initiate_media(PurpleConnection *gc, const char *who, |
2617 PurpleMediaSessionType type) | 2617 PurpleMediaSessionType type) |
2618 { | 2618 { |
2619 #ifdef USE_VV | 2619 #ifdef USE_VV |
2620 JabberStream *js = (JabberStream *) gc->proto_data; | 2620 JabberStream *js = (JabberStream *) gc->proto_data; |
2621 JabberBuddy *jb; | 2621 JabberBuddy *jb; |
2622 | 2622 |
2623 if (!js) { | 2623 if (!js) { |
2624 purple_debug_error("jabber", | 2624 purple_debug_error("jabber", |
2625 "jabber_initiate_media: NULL stream\n"); | 2625 "jabber_initiate_media: NULL stream\n"); |
2626 return NULL; | 2626 return FALSE; |
2627 } | 2627 } |
2628 | 2628 |
2629 jb = jabber_buddy_find(js, who, FALSE); | 2629 jb = jabber_buddy_find(js, who, FALSE); |
2630 | 2630 |
2631 if (!jb) { | 2631 if (!jb) { |
2632 purple_debug_error("jabber", "Could not find buddy\n"); | 2632 purple_debug_error("jabber", "Could not find buddy\n"); |
2633 return NULL; | 2633 return FALSE; |
2634 } | 2634 } |
2635 | 2635 |
2636 if (type & PURPLE_MEDIA_AUDIO && | 2636 if (type & PURPLE_MEDIA_AUDIO && |
2637 !jabber_buddy_has_capability(jb, | 2637 !jabber_buddy_has_capability(jb, |
2638 JINGLE_APP_RTP_SUPPORT_AUDIO) && | 2638 JINGLE_APP_RTP_SUPPORT_AUDIO) && |
2639 jabber_buddy_has_capability(jb, GOOGLE_VOICE_CAP)) | 2639 jabber_buddy_has_capability(jb, GOOGLE_VOICE_CAP)) |
2640 return jabber_google_session_initiate(gc->proto_data, who, type); | 2640 return jabber_google_session_initiate(gc->proto_data, who, type); |
2641 else | 2641 else |
2642 return jingle_rtp_initiate_media(gc->proto_data, who, type); | 2642 return jingle_rtp_initiate_media(gc->proto_data, who, type); |
2643 #else | 2643 #else |
2644 return NULL; | 2644 return FALSE; |
2645 #endif | 2645 #endif |
2646 } | 2646 } |
2647 | 2647 |
2648 PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who) | 2648 PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who) |
2649 { | 2649 { |