mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-15 02:44:20 -05:00
documenting p3chatservice,
added 'idle' status to status service - idle status not saved git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2790 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
40da50799e
commit
f1dab2b094
@ -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;
|
||||
|
@ -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<RsChatMsgItem *> getChatQueue();
|
||||
|
||||
|
@ -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<std::string, StatusInfo> 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<std::string, StatusInfo> pr(statusInfo.id, statusInfo);
|
||||
mStatusInfoMap.insert(pr);
|
||||
IndicateConfigChanged();
|
||||
}else
|
||||
if(mStatusInfoMap[statusInfo.id].status != statusInfo.status){
|
||||
|
||||
IndicateConfigChanged();
|
||||
mStatusInfoMap[statusInfo.id] = statusInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mConnMgr->getOnlineList(onlineList);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user