mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
add patch for vacation status
This commit is contained in:
parent
686a470978
commit
e5f1ae5773
7 changed files with 58 additions and 3 deletions
|
|
@ -325,6 +325,23 @@ entity=\"%s\">\n\
|
|||
<rpid:activities><rpid:away/></rpid:activities>\n\
|
||||
</dm:person>\n\
|
||||
</presence>",
|
||||
contact_info, contact_info);
|
||||
}
|
||||
else if (online_status == SalPresenceOnVacation)
|
||||
{
|
||||
snprintf(buf, buflen, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
|
||||
<presence xmlns=\"urn:ietf:params:xml:ns:pidf\" \
|
||||
xmlns:dm=\"urn:ietf:params:xml:ns:pidf:data-model\" \
|
||||
xmlns:rpid=\"urn:ietf:params:xml:ns:pidf:rpid\" \
|
||||
entity=\"%s\">\n\
|
||||
<tuple id=\"sg89ae\">\n\
|
||||
<status><basic>open</basic></status>\n\
|
||||
<contact priority=\"0.8\">%s</contact>\n\
|
||||
</tuple>\n\
|
||||
<dm:person id=\"sg89aep\">\n\
|
||||
<rpid:activities><rpid:vacation/></rpid:activities>\n\
|
||||
</dm:person>\n\
|
||||
</presence>",
|
||||
contact_info, contact_info);
|
||||
}
|
||||
else if (online_status==SalPresenceOnthephone)
|
||||
|
|
@ -356,7 +373,7 @@ entity=\"%s\">\n\
|
|||
<contact priority=\"0.8\">%s</contact>\n\
|
||||
</tuple>\n\
|
||||
<dm:person id=\"78787878\">\n\
|
||||
<rpid:activities><rpid:meal/></rpid:activities>\n\
|
||||
<rpid:activities><rpid:lunch/></rpid:activities>\n\
|
||||
<rpid:note>Out to lunch</rpid:note> \n\
|
||||
</dm:person>\n\
|
||||
</presence>",
|
||||
|
|
@ -533,12 +550,15 @@ static void presence_process_request_event(void *op_base, const belle_sip_reques
|
|||
|| strstr(body,"on-the-phone")!=NULL){
|
||||
estatus=SalPresenceOnthephone;
|
||||
}else if (strstr(body,"outtolunch")!=NULL
|
||||
|| strstr(body,"lunch")!=NULL
|
||||
|| strstr(body,"meal")!=NULL){
|
||||
estatus=SalPresenceOuttolunch;
|
||||
}else if (strstr(body,"closed")!=NULL){
|
||||
estatus=SalPresenceOffline;
|
||||
}else if ((strstr(body,"online")!=NULL) || (strstr(body,"open")!=NULL)) {
|
||||
estatus=SalPresenceOnline;
|
||||
}else if((strstr(body,"vacation")!=NULL)) {
|
||||
estatus = SalPresenceOnVacation;
|
||||
}else{
|
||||
estatus=SalPresenceOffline;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ const char *linphone_online_status_to_string(LinphoneOnlineStatus ss){
|
|||
case LinphoneStatusPending:
|
||||
str=_("Pending");
|
||||
break;
|
||||
case LinphoneStatusVacation:
|
||||
str=_("Vacation");
|
||||
default:
|
||||
str=_("Unknown-bug");
|
||||
}
|
||||
|
|
@ -259,6 +261,9 @@ SalPresenceStatus linphone_online_status_to_sal(LinphoneOnlineStatus os){
|
|||
case LinphoneStatusPending:
|
||||
return SalPresenceOffline;
|
||||
break;
|
||||
case LinphoneStatusVacation:
|
||||
return SalPresenceOnVacation;
|
||||
break;
|
||||
default:
|
||||
return SalPresenceOffline;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -97,6 +97,11 @@ typedef enum _LinphoneOnlineStatus{
|
|||
*/
|
||||
LinphoneStatusPending,
|
||||
|
||||
/**
|
||||
* Vacation
|
||||
*/
|
||||
LinphoneStatusVacation,
|
||||
|
||||
LinphoneStatusEnd
|
||||
}LinphoneOnlineStatus;
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,9 @@ void linphone_notify_recv(LinphoneCore *lc, SalOp *op, SalSubscribeStatus ss, Sa
|
|||
case SalPresenceDonotdisturb:
|
||||
estatus=LinphoneStatusDoNotDisturb;
|
||||
break;
|
||||
case SalPresenceOnVacation:
|
||||
estatus=LinphoneStatusVacation;
|
||||
break;
|
||||
case SalPresenceMoved:
|
||||
case SalPresenceAltService:
|
||||
estatus=LinphoneStatusMoved;
|
||||
|
|
|
|||
|
|
@ -520,6 +520,23 @@ contact_info, contact_info);
|
|||
"<rpid:activities><rpid:away/></rpid:activities>\n"
|
||||
"</dm:person>\n"
|
||||
"</presence>",
|
||||
contact_info, contact_info);
|
||||
}
|
||||
else if (online_status == SalPresenceOnVacation)
|
||||
{
|
||||
snprintf(buf, buflen, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<presence xmlns=\"urn:ietf:params:xml:ns:pidf\" "
|
||||
"xmlns:dm=\"urn:ietf:params:xml:ns:pidf:data-model\" "
|
||||
"xmlns:rpid=\"urn:ietf:params:xml:ns:pidf:rpid\" "
|
||||
"entity=\"%s\">\n"
|
||||
"<tuple id=\"sg89ae\">\n"
|
||||
"<status><basic>open</basic></status>\n"
|
||||
"<contact priority=\"0.8\">%s</contact>\n"
|
||||
"</tuple>\n"
|
||||
"<dm:person id=\"sg89aep\">\n"
|
||||
"<rpid:activities><rpid:vacation/></rpid:activities>\n"
|
||||
"</dm:person>\n"
|
||||
"</presence>",
|
||||
contact_info, contact_info);
|
||||
}
|
||||
else if (online_status==SalPresenceOnthephone)
|
||||
|
|
@ -551,7 +568,7 @@ contact_info, contact_info);
|
|||
"<contact priority=\"0.8\">%s</contact>\n"
|
||||
"</tuple>\n"
|
||||
"<dm:person id=\"78787878\">\n"
|
||||
"<rpid:activities><rpid:meal/></rpid:activities>\n"
|
||||
"<rpid:activities><rpid:lunch/></rpid:activities>\n"
|
||||
"<rpid:note>Out to lunch</rpid:note> \n"
|
||||
"</dm:person>\n"
|
||||
"</presence>",
|
||||
|
|
@ -737,12 +754,15 @@ void sal_exosip_notify_recv(Sal *sal, eXosip_event_t *ev){
|
|||
|| strstr(body->body,"on-the-phone")!=NULL){
|
||||
estatus=SalPresenceOnthephone;
|
||||
}else if (strstr(body->body,"outtolunch")!=NULL
|
||||
|| strstr(body->body,"lunch") != NULL
|
||||
|| strstr(body->body,"meal")!=NULL){
|
||||
estatus=SalPresenceOuttolunch;
|
||||
}else if (strstr(body->body,"closed")!=NULL){
|
||||
estatus=SalPresenceOffline;
|
||||
}else if ((strstr(body->body,"online")!=NULL) || (strstr(body->body,"open")!=NULL)) {
|
||||
estatus=SalPresenceOnline;
|
||||
}else if(strstr(body->body,"vacation") != NULL) {
|
||||
estatus = SalPresenceOnVacation;
|
||||
}else{
|
||||
estatus=SalPresenceOffline;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,6 +288,7 @@ typedef enum SalPresenceStatus{
|
|||
SalPresenceDonotdisturb,
|
||||
SalPresenceMoved,
|
||||
SalPresenceAltService,
|
||||
SalPresenceOnVacation
|
||||
}SalPresenceStatus;
|
||||
|
||||
const char* sal_presence_status_to_string(const SalPresenceStatus status);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ void notify_presence_received(LinphoneCore *lc, LinphoneFriend * lf) {
|
|||
case LinphoneStatusAltService: counters->number_of_LinphoneStatusMoved++; break;
|
||||
case LinphoneStatusPending: counters->number_of_LinphoneStatusPending++; break;
|
||||
case LinphoneStatusEnd: counters->number_of_LinphoneStatusEnd++; break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue