diff --git a/libretroshare/src/rsserver/p3status.cc b/libretroshare/src/rsserver/p3status.cc index 63656bc03..01dfa4e78 100644 --- a/libretroshare/src/rsserver/p3status.cc +++ b/libretroshare/src/rsserver/p3status.cc @@ -66,6 +66,11 @@ void p3Status::getStatusString(uint32_t status, std::string& statusString){ }else if (status == RS_STATUS_ONLINE){ statusString = "Online"; + + }else if(status == RS_STATUS_INACTIVE){ + + statusString = "Inactive"; + } return; diff --git a/libretroshare/src/services/p3chatservice.h b/libretroshare/src/services/p3chatservice.h index 697a349f3..d80e61015 100644 --- a/libretroshare/src/services/p3chatservice.h +++ b/libretroshare/src/services/p3chatservice.h @@ -65,7 +65,7 @@ class p3ChatService: public p3Service, public p3Config int sendPrivateChat(std::wstring msg, std::string id); /*! - * can be used to send status msgs, these status updates are meant for immediate use by peer at other end + * can be used to send 'immediate' status msgs, these status updates are meant for immediate use by peer (not saved by rs) * e.g currently used to update user when a peer 'is typing' during a chat */ void sendStatusString(const std::string& peer_id,const std::string& status_str) ; @@ -77,7 +77,7 @@ class p3ChatService: public p3Service, public p3Config void sendGroupChatStatusString(const std::string& status_str) ; /*! - * this retrieves custom status for a peers, if not generate a request for the user + * this retrieves custom status for a peers, generate a requests to the peer * @param peer_id the id of the peer you want status string for */ std::string getCustomStateString(const std::string& peer_id) ; @@ -106,6 +106,7 @@ class p3ChatService: public p3Service, public p3Config /*! * Gets the avatar data for clients account + * data is in jpeg format */ void getOwnAvatarJpegData(unsigned char *& data,int& size) ; @@ -113,6 +114,9 @@ class p3ChatService: public p3Service, public p3Config /*! * This retrieves all chat msg items and also (important!) * processes chat-status items that are in service item queue. chat msg item requests are also processed and not returned + * (important! also) notifications sent to notify base on receipt avatar, immediate status and custom status + * : notifyCustomState, notifyChatStatus, notifyPeerHasNewAvatar + * @see NotifyBase */ std::list getChatQueue(); diff --git a/libretroshare/src/services/p3statusservice.cc b/libretroshare/src/services/p3statusservice.cc index ca80907f8..8ad0bed60 100644 --- a/libretroshare/src/services/p3statusservice.cc +++ b/libretroshare/src/services/p3statusservice.cc @@ -143,20 +143,23 @@ bool p3StatusService::sendStatus(StatusInfo& statusInfo) if(statusInfo.id != mConnMgr->getOwnId()) return false; - // If your id is not set, set it - if(mStatusInfoMap.find(statusInfo.id) == mStatusInfoMap.end()){ + // don't save inactive status + if(statusInfo.status != RS_STATUS_INACTIVE){ - std::pair pr(statusInfo.id, statusInfo); - mStatusInfoMap.insert(pr); - IndicateConfigChanged(); - }else - if(mStatusInfoMap[statusInfo.id].status != statusInfo.status){ + // If your id is not set, set it + if(mStatusInfoMap.find(statusInfo.id) == mStatusInfoMap.end()){ - IndicateConfigChanged(); - mStatusInfoMap[statusInfo.id] = statusInfo; + std::pair pr(statusInfo.id, statusInfo); + mStatusInfoMap.insert(pr); + IndicateConfigChanged(); + }else + if(mStatusInfoMap[statusInfo.id].status != statusInfo.status){ + + IndicateConfigChanged(); + mStatusInfoMap[statusInfo.id] = statusInfo; + } } - mConnMgr->getOnlineList(onlineList); }