Changeset 1424 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
- Timestamp:
- Aug 25, 2007 1:36:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r1423 r1424 114 114 } else if (pjsua_var.buddy[buddy_id].status.info[0].basic_open) { 115 115 info->status = PJSUA_BUDDY_STATUS_ONLINE; 116 info->status_text = pj_str("Online"); 116 117 /* copy RPID information */ 118 info->rpid = buddy->status.info[0].rpid; 119 120 if (info->rpid.note.slen) 121 info->status_text = info->rpid.note; 122 else 123 info->status_text = pj_str("Online"); 124 117 125 } else { 118 126 info->status = PJSUA_BUDDY_STATUS_OFFLINE; … … 653 661 pres_status.info[0].basic_open = acc->online_status; 654 662 pres_status.info[0].id = acc->cfg.pidf_tuple_id; 663 /* .. including RPID information */ 664 pj_memcpy(&pres_status.info[0].rpid, &acc->rpid, 665 sizeof(pjrpid_element)); 655 666 656 667 /* Be careful not to send PIDF with presence entity ID containing … … 822 833 823 834 824 /* Refreshsubscription (e.g. when our online status has changed) */825 static void refresh_server_subscription(int acc_id)835 /* Update server subscription (e.g. when our online status has changed) */ 836 void pjsua_pres_update_acc(int acc_id, pj_bool_t force) 826 837 { 827 838 pjsua_acc *acc = &pjsua_var.acc[acc_id]; … … 837 848 838 849 pjsip_pres_get_status(uapres->sub, &pres_status); 839 if (pres_status.info[0].basic_open != acc->online_status) { 850 if (force || pres_status.info[0].basic_open != acc->online_status) { 851 840 852 pres_status.info[0].basic_open = acc->online_status; 853 pj_memcpy(&pres_status.info[0].rpid, &acc->rpid, 854 sizeof(pjrpid_element)); 855 841 856 pjsip_pres_set_status(uapres->sub, &pres_status); 842 857 … … 856 871 */ 857 872 if (acc_cfg->publish_enabled && acc->publish_sess) { 858 if ( acc->publish_state != acc->online_status) {873 if (force || acc->publish_state != acc->online_status) { 859 874 send_publish(acc_id, PJ_TRUE); 860 875 } … … 1252 1267 for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { 1253 1268 if (pjsua_var.acc[i].valid) 1254 refresh_server_subscription(i);1269 pjsua_pres_update_acc(i, PJ_FALSE); 1255 1270 } 1256 1271 }
Note: See TracChangeset
for help on using the changeset viewer.