Changeset 574:6e81709820b4 in qutecom-2.2 for libs/sipwrapper/src/phapi/PhApiWrapper.cpp
- Timestamp:
- Mar 10, 2010 4:06:04 PM (3 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
libs/sipwrapper/src/phapi/PhApiWrapper.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libs/sipwrapper/src/phapi/PhApiWrapper.cpp
r439 r574 159 159 160 160 161 isOnline = false; 161 isOpen = false; 162 presence_activities = "close"; 162 163 163 164 } … … 348 349 } 349 350 350 publish Offline(String::null);351 publishPresence(false,"offline",String::null); 351 352 sleep(2); 352 353 owplLineDelete(lineId, force); … … 685 686 switch(state) { 686 687 case EnumPresenceState::PresenceStateOnline: 687 publish Online(PresenceStateOnline);688 publishPresence(true,"unknow",note); 688 689 break; 689 690 690 691 case EnumPresenceState::PresenceStateAway: 691 publish Online(PresenceStateAway);692 publishPresence(true,"away",note); 692 693 break; 693 694 694 695 case EnumPresenceState::PresenceStateDoNotDisturb: 695 publish Online(PresenceStateDoNotDisturb);696 publishPresence(false,"busy",note); 696 697 break; 697 698 698 699 case EnumPresenceState::PresenceStateUserDefined: 699 700 if (!sipOptions.sip_p2p_presence) 700 publish Online(note);701 publishPresence(true,presence_activities,note); 701 702 break; 702 703 703 704 case EnumPresenceState::PresenceStateInvisible: 705 publishPresence(false,"unknow",note); 706 break; 707 704 708 case EnumPresenceState::PresenceStateOffline: 705 publish Offline(note);709 publishPresence(false,"unknow",note); 706 710 break; 707 711 … … 729 733 } 730 734 731 void PhApiWrapper::publishOnline(const std::string & note) {735 /*void PhApiWrapper::publishOnline(const std::string & note) { 732 736 if (_isInitialized) { 733 737 publishPresence(true, note); … … 739 743 publishPresence(false, note); 740 744 } 741 } 742 743 void PhApiWrapper::publishPresence(bool o nline, const std::string & note) {745 }*/ 746 747 void PhApiWrapper::publishPresence(bool open, const std::string & activities, const std::string & note) { 744 748 static const std::string contentType = "application/pidf+xml"; 745 749 746 750 if (_isInitialized) { 747 isOnline = online; 751 isOpen = open; 752 presence_activities = activities; 748 753 presence_note = note; 749 754 … … 752 757 for (InSubIter isub = _incomingSubscriptions.begin(); isub != _incomingSubscriptions.end(); isub++) 753 758 if (isub->second.state == SUBCONFIRMED) 754 owplPresenceNotify(_wengoVline, isub->first, (o nline)?1:0, note.c_str(), 0);759 owplPresenceNotify(_wengoVline, isub->first, (open)?1:0, activities.c_str(), note.c_str(), 0); 755 760 756 761 myPresenceStatusEvent(*this, EnumPresenceState::MyPresenceStatusOk, note); 757 762 758 763 } 759 else if(owplPresencePublish(_wengoVline, (o nline)?1:0, note.c_str(), NULL) != OWPL_RESULT_SUCCESS) {764 else if(owplPresencePublish(_wengoVline, (open)?1:0, activities.c_str(), note.c_str()) != OWPL_RESULT_SUCCESS) { 760 765 myPresenceStatusEvent(*this, EnumPresenceState::MyPresenceStatusError, note); 761 766 } else { … … 806 811 807 812 // FIXME: will not work in multiline mode 808 owplSubscribeAccept(_wengoVline, sid, 202, (int) isO nline, presence_note.c_str());813 owplSubscribeAccept(_wengoVline, sid, 202, (int) isOpen , presence_activities.c_str() , presence_note.c_str()); 809 814 810 815
Note: See TracChangeset
for help on using the changeset viewer.
