Commit 411ae723 authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

friend.c: fix some stuff

parent 63fe9fad
......@@ -618,14 +618,29 @@ LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf){
const LinphonePresenceModel * linphone_friend_get_presence_model(const LinphoneFriend *lf) {
const LinphonePresenceModel *presence = NULL;
LinphoneAddress *addr = linphone_friend_get_address(lf);
if (addr) {
LinphoneFriend* fuckconst = (LinphoneFriend*)lf;
bctbx_list_t* addrs = linphone_friend_get_addresses(fuckconst);
bctbx_list_t* phones = NULL;
while (addrs) {
LinphoneAddress *addr = addrs->data;
char *uri = linphone_address_as_string_uri_only(addr);
presence = linphone_friend_get_presence_model_for_uri_or_tel(lf, uri);
presence = linphone_friend_get_presence_model_for_uri_or_tel(fuckconst, uri);
ms_free(uri);
linphone_address_unref(addr);
if (presence) return presence;
addrs = addrs->next;
}
return presence;
phones = linphone_friend_get_phone_numbers(fuckconst);
while (phones) {
presence = linphone_friend_get_presence_model_for_uri_or_tel(fuckconst, phones->data);
if (presence) return presence;
phones = phones->next;
}
return NULL;
}
const LinphonePresenceModel * linphone_friend_get_presence_model_for_uri_or_tel(const LinphoneFriend *lf, const char *uri_or_tel) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment