Commit 111434ee authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fixed do not disturb led color

parent 4ebe3b5f
...@@ -460,6 +460,7 @@ LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf){ ...@@ -460,6 +460,7 @@ LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf){
LinphoneOnlineStatus online_status = LinphoneStatusOffline; LinphoneOnlineStatus online_status = LinphoneStatusOffline;
LinphonePresenceBasicStatus basic_status = LinphonePresenceBasicStatusClosed; LinphonePresenceBasicStatus basic_status = LinphonePresenceBasicStatusClosed;
LinphonePresenceActivity *activity = NULL; LinphonePresenceActivity *activity = NULL;
const char *description = NULL;
unsigned int nb_activities = 0; unsigned int nb_activities = 0;
if (lf->presence != NULL) { if (lf->presence != NULL) {
...@@ -476,6 +477,7 @@ LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf){ ...@@ -476,6 +477,7 @@ LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf){
} }
if (nb_activities == 1) { if (nb_activities == 1) {
activity = linphone_presence_model_get_activity(lf->presence); activity = linphone_presence_model_get_activity(lf->presence);
description = linphone_presence_activity_get_description(activity);
switch (linphone_presence_activity_get_type(activity)) { switch (linphone_presence_activity_get_type(activity)) {
case LinphonePresenceActivityBreakfast: case LinphonePresenceActivityBreakfast:
case LinphonePresenceActivityDinner: case LinphonePresenceActivityDinner:
...@@ -502,6 +504,12 @@ LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf){ ...@@ -502,6 +504,12 @@ LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf){
online_status = LinphoneStatusVacation; online_status = LinphoneStatusVacation;
break; break;
case LinphonePresenceActivityBusy: case LinphonePresenceActivityBusy:
if (description && strcmp(description, "Do not disturb") == 0) { // See linphonecore.c linphone_core_set_presence_info() method
online_status = LinphoneStatusDoNotDisturb;
} else {
online_status = LinphoneStatusBusy;
}
break;
case LinphonePresenceActivityLookingForWork: case LinphonePresenceActivityLookingForWork:
case LinphonePresenceActivityPlaying: case LinphonePresenceActivityPlaying:
case LinphonePresenceActivityShopping: case LinphonePresenceActivityShopping:
......
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