Mercurial > pidgin
comparison libpurple/protocols/mxit/voicevideo.c @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 02 Jun 2012 02:30:49 +0000 |
parents | 4b15c5c68aa4 |
children |
comparison
equal
deleted
inserted
replaced
32818:01ff09d4a463 | 32819:2c6510167895 |
---|---|
61 * @param who The username of the contact. | 61 * @param who The username of the contact. |
62 * @return The media capabilities supported | 62 * @return The media capabilities supported |
63 */ | 63 */ |
64 PurpleMediaCaps mxit_media_caps(PurpleAccount *account, const char *who) | 64 PurpleMediaCaps mxit_media_caps(PurpleAccount *account, const char *who) |
65 { | 65 { |
66 struct MXitSession* session = purple_account_get_connection(account)->proto_data; | 66 struct MXitSession* session = purple_connection_get_protocol_data(purple_account_get_connection(account)); |
67 PurpleBuddy* buddy; | 67 PurpleBuddy* buddy; |
68 struct contact* contact; | 68 struct contact* contact; |
69 PurpleMediaCaps capa = PURPLE_MEDIA_CAPS_NONE; | 69 PurpleMediaCaps capa = PURPLE_MEDIA_CAPS_NONE; |
70 | 70 |
71 purple_debug_info(MXIT_PLUGIN_ID, "mxit_media_caps: buddy '%s'\n", who); | 71 purple_debug_info(MXIT_PLUGIN_ID, "mxit_media_caps: buddy '%s'\n", who); |
72 | 72 |
73 /* We need to have a voice/video server */ | 73 /* We need to have a voice/video server */ |
74 if (strlen(session->voip_server) == 0) | 74 if (!*session->voip_server) |
75 return PURPLE_MEDIA_CAPS_NONE; | 75 return PURPLE_MEDIA_CAPS_NONE; |
76 | 76 |
77 /* find the buddy information for this contact (reference: "libpurple/blist.h") */ | 77 /* find the buddy information for this contact (reference: "libpurple/blist.h") */ |
78 buddy = purple_find_buddy(account, who); | 78 buddy = purple_find_buddy(account, who); |
79 if (!buddy) { | 79 if (!buddy) { |
93 if (contact->subtype != MXIT_SUBTYPE_BOTH) | 93 if (contact->subtype != MXIT_SUBTYPE_BOTH) |
94 return PURPLE_MEDIA_CAPS_NONE; | 94 return PURPLE_MEDIA_CAPS_NONE; |
95 | 95 |
96 /* and only when they're online */ | 96 /* and only when they're online */ |
97 if (contact->presence == MXIT_PRESENCE_OFFLINE) | 97 if (contact->presence == MXIT_PRESENCE_OFFLINE) |
98 return MXIT_PRESENCE_OFFLINE; | 98 return PURPLE_MEDIA_CAPS_NONE; |
99 | 99 |
100 /* they support voice-only */ | 100 /* they support voice-only */ |
101 if (contact->capabilities & MXIT_PFLAG_VOICE) | 101 if (contact->capabilities & MXIT_PFLAG_VOICE) |
102 capa |= PURPLE_MEDIA_CAPS_AUDIO; | 102 capa |= PURPLE_MEDIA_CAPS_AUDIO; |
103 | 103 |