mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
added backend for distant message and distant chat filtering based on contact list
This commit is contained in:
parent
f5c2aa31e3
commit
140205108a
20 changed files with 373 additions and 180 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sstream>
|
||||
|
||||
#include "openssl/rand.h"
|
||||
#include "openssl/dh.h"
|
||||
|
@ -108,6 +109,17 @@ void DistantChatService::handleRecvChatStatusItem(RsChatStatusItem *cs)
|
|||
std::cerr << "DistantChatService::handleRecvChatStatusItem(): received keep alive packet for inactive chat! peerId=" << cs->PeerId() << std::endl;
|
||||
}
|
||||
|
||||
bool DistantChatService::acceptDataFromPeer(const RsGxsId& gxs_id)
|
||||
{
|
||||
if(mDistantChatPermissions & RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS)
|
||||
return (rsIdentity!=NULL) && rsIdentity->isARegularContact(gxs_id) ;
|
||||
|
||||
if(mDistantChatPermissions & RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_EVERYBODY)
|
||||
return false ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
void DistantChatService::notifyTunnelStatus(const RsGxsTunnelService::RsGxsTunnelId &tunnel_id, uint32_t tunnel_status)
|
||||
{
|
||||
std::cerr << "DistantChatService::notifyTunnelStatus(): got notification " << std::hex << tunnel_status << std::dec << " for tunnel " << tunnel_id << std::endl;
|
||||
|
@ -137,9 +149,7 @@ void DistantChatService::receiveData(const RsGxsTunnelService::RsGxsTunnelId &tu
|
|||
std::cerr << "DistantChatService::receiveData(): got data of size " << data_size << " for tunnel " << tunnel_id << std::endl;
|
||||
std::cerr << " received: " << RsUtil::BinToHex(data,data_size) << std::endl;
|
||||
std::cerr << " deserialising..." << std::endl;
|
||||
|
||||
RsItem *item = RsChatSerialiser().deserialise(data,&data_size) ;
|
||||
|
||||
|
||||
// always make the contact up to date. This is useful for server side, which doesn't know about the chat until it
|
||||
// receives the first item.
|
||||
{
|
||||
|
@ -149,21 +159,26 @@ void DistantChatService::receiveData(const RsGxsTunnelService::RsGxsTunnelId &tu
|
|||
if(!mGxsTunnels->getTunnelInfo(tunnel_id,tinfo))
|
||||
return ;
|
||||
|
||||
// Check if the data is accepted. We cannot prevent the creation of tunnels at the level of p3GxsTunnels, since tunnels are shared between services.
|
||||
// however,
|
||||
|
||||
DistantChatContact& contact(mDistantChatContacts[DistantChatPeerId(tunnel_id)]) ;
|
||||
|
||||
|
||||
contact.to_id = tinfo.destination_gxs_id ;
|
||||
contact.from_id = tinfo.source_gxs_id ;
|
||||
}
|
||||
|
||||
|
||||
RsItem *item = RsChatSerialiser().deserialise(data,&data_size) ;
|
||||
|
||||
if(item != NULL)
|
||||
{
|
||||
item->PeerId(RsPeerId(tunnel_id)) ; // just in case, but normally this is already done.
|
||||
|
||||
item->PeerId(RsPeerId(tunnel_id)) ; // just in case, but normally this is already done.
|
||||
|
||||
handleIncomingItem(item) ;
|
||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD);
|
||||
}
|
||||
else
|
||||
std::cerr << " (EE) item could not be deserialised!" << std::endl;
|
||||
std::cerr << " (EE) item could not be deserialised!" << std::endl;
|
||||
}
|
||||
|
||||
void DistantChatService::markDistantChatAsClosed(const DistantChatPeerId& dcpid)
|
||||
|
@ -243,4 +258,62 @@ bool DistantChatService::closeDistantChatConnexion(const DistantChatPeerId &tunn
|
|||
return true ;
|
||||
}
|
||||
|
||||
uint32_t DistantChatService::getDistantChatPermissionFlags()
|
||||
{
|
||||
return mDistantChatPermissions ;
|
||||
}
|
||||
bool DistantChatService::setDistantChatPermissionFlags(uint32_t flags)
|
||||
{
|
||||
if(mDistantChatPermissions != flags)
|
||||
{
|
||||
mDistantChatPermissions = flags ;
|
||||
std::cerr << "(II) Changing distant chat permissions to " << flags << ". Existing openned chats will however remain active until closed" << std::endl;
|
||||
triggerConfigSave() ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
void DistantChatService::addToSaveList(std::list<RsItem*>& list) const
|
||||
{
|
||||
/* Save permission flags */
|
||||
|
||||
RsConfigKeyValueSet *vitem = new RsConfigKeyValueSet ;
|
||||
RsTlvKeyValue kv;
|
||||
kv.key = "DISTANT_CHAT_PERMISSION_FLAGS" ;
|
||||
kv.value = RsUtil::NumberToString(mDistantChatPermissions) ;
|
||||
|
||||
vitem->tlvkvs.pairs.push_back(kv) ;
|
||||
|
||||
list.push_back(vitem) ;
|
||||
}
|
||||
bool DistantChatService::processLoadListItem(const RsItem *item)
|
||||
{
|
||||
const RsConfigKeyValueSet *vitem = NULL ;
|
||||
|
||||
if(NULL != (vitem = dynamic_cast<const RsConfigKeyValueSet*>(item)))
|
||||
for(std::list<RsTlvKeyValue>::const_iterator kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit)
|
||||
if(kit->key == "DISTANT_CHAT_PERMISSION_FLAGS")
|
||||
{
|
||||
#ifdef DEBUG_DISTANT_CHAT
|
||||
std::cerr << "Loaded distant chat permission flags: " << kit->value << std::endl ;
|
||||
#endif
|
||||
if (!kit->value.empty())
|
||||
{
|
||||
std::istringstream is(kit->value) ;
|
||||
|
||||
uint32_t tmp ;
|
||||
is >> tmp ;
|
||||
|
||||
if(tmp < 3)
|
||||
mDistantChatPermissions = tmp ;
|
||||
else
|
||||
std::cerr << "(EE) Invalid value read for DistantChatPermission flags in config: " << tmp << std::endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,18 +42,27 @@ public:
|
|||
DistantChatService() : mDistantChatMtx("distant chat")
|
||||
{
|
||||
mGxsTunnels = NULL ;
|
||||
mDistantChatPermissions = RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_NONE ; // default: accept everyone
|
||||
}
|
||||
|
||||
// Overloaded methods from RsGxsTunnelClientService
|
||||
virtual void triggerConfigSave()=0 ;
|
||||
bool processLoadListItem(const RsItem *item) ;
|
||||
void addToSaveList(std::list<RsItem*>& list) const;
|
||||
|
||||
virtual void connectToGxsTunnelService(RsGxsTunnelService *tunnel_service) ;
|
||||
|
||||
// Creates the invite if the public key of the distant peer is available.
|
||||
// Om success, stores the invite in the map above, so that we can respond to tunnel requests.
|
||||
//
|
||||
bool initiateDistantChatConnexion(const RsGxsId& to_gxs_id, const RsGxsId &from_gxs_id, DistantChatPeerId& dcpid, uint32_t &error_code) ;
|
||||
bool closeDistantChatConnexion(const DistantChatPeerId &tunnel_id) ;
|
||||
|
||||
// Sets flags to only allow connexion from some people.
|
||||
|
||||
uint32_t getDistantChatPermissionFlags() ;
|
||||
bool setDistantChatPermissionFlags(uint32_t flags) ;
|
||||
|
||||
// Returns the status of a distant chat contact. The contact is defined by the tunnel id (turned into a DistantChatPeerId) because
|
||||
// each pair of talking GXS id needs to be treated separately
|
||||
|
||||
virtual bool getDistantChatStatus(const DistantChatPeerId &tunnel_id, DistantChatPeerInfo& cinfo) ;
|
||||
|
||||
// derived in p3ChatService, so as to pass down some info
|
||||
|
@ -74,8 +83,17 @@ private:
|
|||
//
|
||||
std::map<DistantChatPeerId, DistantChatContact> mDistantChatContacts ; // current peers we can talk to
|
||||
|
||||
// Permission handling
|
||||
|
||||
uint32_t mDistantChatPermissions ;
|
||||
|
||||
// Overloaded from RsGxsTunnelClientService
|
||||
|
||||
public:
|
||||
virtual void connectToGxsTunnelService(RsGxsTunnelService *tunnel_service) ;
|
||||
|
||||
private:
|
||||
virtual bool acceptDataFromPeer(const RsGxsId& gxs_id) ;
|
||||
virtual void notifyTunnelStatus(const RsGxsTunnelService::RsGxsTunnelId& tunnel_id,uint32_t tunnel_status) ;
|
||||
virtual void receiveData(const RsGxsTunnelService::RsGxsTunnelId& id,unsigned char *data,uint32_t data_size) ;
|
||||
|
||||
|
@ -84,6 +102,5 @@ private:
|
|||
void markDistantChatAsClosed(const DistantChatPeerId& dcpid) ;
|
||||
|
||||
RsGxsTunnelService *mGxsTunnels ;
|
||||
|
||||
RsMutex mDistantChatMtx ;
|
||||
};
|
||||
|
|
|
@ -1903,19 +1903,19 @@ bool DistributedChatService::processLoadListItem(const RsItem *item)
|
|||
if(NULL != (vitem = dynamic_cast<const RsConfigKeyValueSet*>(item)))
|
||||
for(std::list<RsTlvKeyValue>::const_iterator kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit)
|
||||
if(kit->key == "DEFAULT_IDENTITY")
|
||||
{
|
||||
{
|
||||
#ifdef DEBUG_CHAT_LOBBIES
|
||||
std::cerr << "Loaded config default nick name for distributed chat: " << kit->value << std::endl ;
|
||||
std::cerr << "Loaded config default nick name for distributed chat: " << kit->value << std::endl ;
|
||||
#endif
|
||||
if (!kit->value.empty())
|
||||
{
|
||||
_default_identity = RsGxsId(kit->value) ;
|
||||
if(_default_identity.isNull())
|
||||
std::cerr << "ERROR: default identity is malformed." << std::endl;
|
||||
}
|
||||
if (!kit->value.empty())
|
||||
{
|
||||
_default_identity = RsGxsId(kit->value) ;
|
||||
if(_default_identity.isNull())
|
||||
std::cerr << "ERROR: default identity is malformed." << std::endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const RsChatLobbyConfigItem *clci = NULL ;
|
||||
|
||||
|
|
|
@ -1192,11 +1192,8 @@ bool p3ChatService::loadList(std::list<RsItem*>& load)
|
|||
continue;
|
||||
}
|
||||
|
||||
if(DistributedChatService::processLoadListItem(*it))
|
||||
{
|
||||
delete *it;
|
||||
continue;
|
||||
}
|
||||
DistributedChatService::processLoadListItem(*it) ;
|
||||
DistantChatService::processLoadListItem(*it) ;
|
||||
|
||||
// delete unknown items
|
||||
delete *it;
|
||||
|
@ -1238,6 +1235,7 @@ bool p3ChatService::saveList(bool& cleanup, std::list<RsItem*>& list)
|
|||
}
|
||||
|
||||
DistributedChatService::addToSaveList(list) ;
|
||||
DistantChatService::addToSaveList(list) ;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -53,186 +53,186 @@ typedef RsPeerId ChatLobbyVirtualPeerId ;
|
|||
*/
|
||||
class p3ChatService: public p3Service, public DistantChatService, public DistributedChatService, public p3Config, public pqiServiceMonitor
|
||||
{
|
||||
public:
|
||||
p3ChatService(p3ServiceControl *cs, p3IdService *pids,p3LinkMgr *cm, p3HistoryMgr *historyMgr);
|
||||
public:
|
||||
p3ChatService(p3ServiceControl *cs, p3IdService *pids,p3LinkMgr *cm, p3HistoryMgr *historyMgr);
|
||||
|
||||
virtual RsServiceInfo getServiceInfo();
|
||||
virtual RsServiceInfo getServiceInfo();
|
||||
|
||||
/***** overloaded from p3Service *****/
|
||||
/*!
|
||||
/***** overloaded from p3Service *****/
|
||||
/*!
|
||||
* 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
|
||||
*/
|
||||
virtual int tick();
|
||||
virtual int tick();
|
||||
|
||||
/*************** pqiMonitor callback ***********************/
|
||||
virtual void statusChange(const std::list<pqiServicePeer> &plist);
|
||||
/*************** pqiMonitor callback ***********************/
|
||||
virtual void statusChange(const std::list<pqiServicePeer> &plist);
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* public chat sent to all peers
|
||||
*/
|
||||
void sendPublicChat(const std::string &msg);
|
||||
void sendPublicChat(const std::string &msg);
|
||||
|
||||
/********* RsMsgs ***********/
|
||||
/*!
|
||||
* Send a chat message.
|
||||
* @param destination where to send the chat message
|
||||
* @param msg the message
|
||||
* @see ChatId
|
||||
*/
|
||||
bool sendChat(ChatId destination, std::string msg);
|
||||
/********* RsMsgs ***********/
|
||||
/*!
|
||||
* Send a chat message.
|
||||
* @param destination where to send the chat message
|
||||
* @param msg the message
|
||||
* @see ChatId
|
||||
*/
|
||||
bool sendChat(ChatId destination, std::string msg);
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* chat is sent to specifc peer
|
||||
* @param id peer to send chat msg to
|
||||
*/
|
||||
bool sendPrivateChat(const RsPeerId &id, const std::string &msg);
|
||||
bool sendPrivateChat(const RsPeerId &id, const std::string &msg);
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* 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 ChatId& peer_id,const std::string& status_str) ;
|
||||
void sendStatusString(const ChatId& peer_id,const std::string& status_str) ;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* send to all peers online
|
||||
*@see sendStatusString()
|
||||
*/
|
||||
void sendGroupChatStatusString(const std::string& status_str) ;
|
||||
void sendGroupChatStatusString(const std::string& status_str) ;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* 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 RsPeerId& peer_id) ;
|
||||
std::string getCustomStateString(const RsPeerId& peer_id) ;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* sets the client's custom status, generates 'status available' item sent to all online peers
|
||||
*/
|
||||
void setOwnCustomStateString(const std::string&) ;
|
||||
void setOwnCustomStateString(const std::string&) ;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* @return client's custom string
|
||||
*/
|
||||
std::string getOwnCustomStateString() ;
|
||||
std::string getOwnCustomStateString() ;
|
||||
|
||||
/*! gets the peer's avatar in jpeg format, if available. Null otherwise. Also asks the peer to send
|
||||
/*! gets the peer's avatar in jpeg format, if available. Null otherwise. Also asks the peer to send
|
||||
* its avatar, if not already available. Creates a new unsigned char array. It's the caller's
|
||||
* responsibility to delete this ones used.
|
||||
*/
|
||||
void getAvatarJpegData(const RsPeerId& peer_id,unsigned char *& data,int& size) ;
|
||||
void getAvatarJpegData(const RsPeerId& peer_id,unsigned char *& data,int& size) ;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* Sets the avatar data and size for client's account
|
||||
* @param data is copied, so should be destroyed by the caller
|
||||
*/
|
||||
void setOwnAvatarJpegData(const unsigned char *data,int size) ;
|
||||
void setOwnAvatarJpegData(const unsigned char *data,int size) ;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* Gets the avatar data for clients account
|
||||
* data is in jpeg format
|
||||
*/
|
||||
void getOwnAvatarJpegData(unsigned char *& data,int& size) ;
|
||||
void getOwnAvatarJpegData(unsigned char *& data,int& size) ;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* Return the max message size for security forwarding
|
||||
* @param type RS_CHAT_TYPE_...
|
||||
* return 0 unlimited
|
||||
*/
|
||||
static uint32_t getMaxMessageSecuritySize(int type);
|
||||
static uint32_t getMaxMessageSecuritySize(int type);
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* Checks message security, especially remove billion laughs attacks
|
||||
*/
|
||||
|
||||
static bool checkForMessageSecurity(RsChatMsgItem *) ;
|
||||
static bool checkForMessageSecurity(RsChatMsgItem *) ;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* @param clear private chat queue
|
||||
*/
|
||||
bool clearPrivateChatQueue(bool incoming, const RsPeerId &id);
|
||||
bool clearPrivateChatQueue(bool incoming, const RsPeerId &id);
|
||||
|
||||
protected:
|
||||
/************* from p3Config *******************/
|
||||
virtual RsSerialiser *setupSerialiser() ;
|
||||
protected:
|
||||
/************* from p3Config *******************/
|
||||
virtual RsSerialiser *setupSerialiser() ;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* chat msg items and custom status are saved
|
||||
*/
|
||||
virtual bool saveList(bool& cleanup, std::list<RsItem*>&) ;
|
||||
virtual void saveDone();
|
||||
virtual bool loadList(std::list<RsItem*>& load) ;
|
||||
virtual bool saveList(bool& cleanup, std::list<RsItem*>&) ;
|
||||
virtual void saveDone();
|
||||
virtual bool loadList(std::list<RsItem*>& load) ;
|
||||
|
||||
// accepts virtual peer id
|
||||
bool isOnline(const RsPeerId &pid) ;
|
||||
// accepts virtual peer id
|
||||
bool isOnline(const RsPeerId &pid) ;
|
||||
|
||||
/// This is to be used by subclasses/parents to call IndicateConfigChanged()
|
||||
virtual void triggerConfigSave() { IndicateConfigChanged() ; }
|
||||
/// Same, for storing messages in incoming list
|
||||
virtual void locked_storeIncomingMsg(RsChatMsgItem *) ;
|
||||
/// This is to be used by subclasses/parents to call IndicateConfigChanged()
|
||||
virtual void triggerConfigSave() { IndicateConfigChanged() ; }
|
||||
/// Same, for storing messages in incoming list
|
||||
virtual void locked_storeIncomingMsg(RsChatMsgItem *) ;
|
||||
|
||||
private:
|
||||
RsMutex mChatMtx;
|
||||
private:
|
||||
RsMutex mChatMtx;
|
||||
|
||||
class AvatarInfo ;
|
||||
class StateStringInfo ;
|
||||
class AvatarInfo ;
|
||||
class StateStringInfo ;
|
||||
|
||||
// Receive chat queue
|
||||
void receiveChatQueue();
|
||||
void handleIncomingItem(RsItem *); // called by the former, and turtle handler for incoming encrypted items
|
||||
// Receive chat queue
|
||||
void receiveChatQueue();
|
||||
void handleIncomingItem(RsItem *); // called by the former, and turtle handler for incoming encrypted items
|
||||
|
||||
virtual void sendChatItem(RsChatItem *) ;
|
||||
virtual void sendChatItem(RsChatItem *) ;
|
||||
|
||||
void initChatMessage(RsChatMsgItem *c, ChatMessage& msg);
|
||||
void initChatMessage(RsChatMsgItem *c, ChatMessage& msg);
|
||||
|
||||
/// Send avatar info to peer in jpeg format.
|
||||
void sendAvatarJpegData(const RsPeerId& peer_id) ;
|
||||
/// Send avatar info to peer in jpeg format.
|
||||
void sendAvatarJpegData(const RsPeerId& peer_id) ;
|
||||
|
||||
/// Send custom state info to peer
|
||||
void sendCustomState(const RsPeerId& peer_id);
|
||||
/// Send custom state info to peer
|
||||
void sendCustomState(const RsPeerId& peer_id);
|
||||
|
||||
/// Receive the avatar in a chat item, with RS_CHAT_RECEIVE_AVATAR flag.
|
||||
void receiveAvatarJpegData(RsChatAvatarItem *ci) ; // new method
|
||||
void receiveStateString(const RsPeerId& id,const std::string& s) ;
|
||||
/// Receive the avatar in a chat item, with RS_CHAT_RECEIVE_AVATAR flag.
|
||||
void receiveAvatarJpegData(RsChatAvatarItem *ci) ; // new method
|
||||
void receiveStateString(const RsPeerId& id,const std::string& s) ;
|
||||
|
||||
/// methods for handling various Chat items.
|
||||
bool handleRecvChatMsgItem(RsChatMsgItem *item) ; // returns false if the item should be deleted.
|
||||
void handleRecvChatStatusItem(RsChatStatusItem *item) ;
|
||||
void handleRecvChatAvatarItem(RsChatAvatarItem *item) ;
|
||||
/// methods for handling various Chat items.
|
||||
bool handleRecvChatMsgItem(RsChatMsgItem *item) ; // returns false if the item should be deleted.
|
||||
void handleRecvChatStatusItem(RsChatStatusItem *item) ;
|
||||
void handleRecvChatAvatarItem(RsChatAvatarItem *item) ;
|
||||
|
||||
/// Sends a request for an avatar to the peer of given id
|
||||
void sendAvatarRequest(const RsPeerId& peer_id) ;
|
||||
/// Sends a request for an avatar to the peer of given id
|
||||
void sendAvatarRequest(const RsPeerId& peer_id) ;
|
||||
|
||||
/// Send a request for custom status string
|
||||
void sendCustomStateRequest(const RsPeerId& peer_id);
|
||||
/// Send a request for custom status string
|
||||
void sendCustomStateRequest(const RsPeerId& peer_id);
|
||||
|
||||
/// called as a proxy to sendItem(). Possibly splits item into multiple items of size lower than the maximum item size.
|
||||
//void checkSizeAndSendMessage(RsChatLobbyMsgItem *item) ;
|
||||
void checkSizeAndSendMessage(RsChatMsgItem *item) ; // keep for compatibility for a few weeks.
|
||||
/// called as a proxy to sendItem(). Possibly splits item into multiple items of size lower than the maximum item size.
|
||||
//void checkSizeAndSendMessage(RsChatLobbyMsgItem *item) ;
|
||||
void checkSizeAndSendMessage(RsChatMsgItem *item) ; // keep for compatibility for a few weeks.
|
||||
|
||||
/// Called when a RsChatMsgItem is received. The item may be collapsed with any waiting partial chat item from the same peer.
|
||||
bool locked_checkAndRebuildPartialMessage(RsChatMsgItem *) ;
|
||||
/// Called when a RsChatMsgItem is received. The item may be collapsed with any waiting partial chat item from the same peer.
|
||||
bool locked_checkAndRebuildPartialMessage(RsChatMsgItem *) ;
|
||||
|
||||
RsChatAvatarItem *makeOwnAvatarItem() ;
|
||||
RsChatStatusItem *makeOwnCustomStateStringItem() ;
|
||||
RsChatAvatarItem *makeOwnAvatarItem() ;
|
||||
RsChatStatusItem *makeOwnCustomStateStringItem() ;
|
||||
|
||||
p3ServiceControl *mServiceCtrl;
|
||||
p3LinkMgr *mLinkMgr;
|
||||
p3HistoryMgr *mHistoryMgr;
|
||||
p3ServiceControl *mServiceCtrl;
|
||||
p3LinkMgr *mLinkMgr;
|
||||
p3HistoryMgr *mHistoryMgr;
|
||||
|
||||
std::list<RsChatMsgItem *> privateOutgoingList; // messages waiting to be send when peer comes online
|
||||
std::list<RsChatMsgItem *> privateOutgoingList; // messages waiting to be send when peer comes online
|
||||
|
||||
AvatarInfo *_own_avatar ;
|
||||
std::map<RsPeerId,AvatarInfo *> _avatars ;
|
||||
std::map<RsPeerId,RsChatMsgItem *> _pendingPartialMessages ;
|
||||
AvatarInfo *_own_avatar ;
|
||||
std::map<RsPeerId,AvatarInfo *> _avatars ;
|
||||
std::map<RsPeerId,RsChatMsgItem *> _pendingPartialMessages ;
|
||||
|
||||
std::string _custom_status_string ;
|
||||
std::map<RsPeerId,StateStringInfo> _state_strings ;
|
||||
std::string _custom_status_string ;
|
||||
std::map<RsPeerId,StateStringInfo> _state_strings ;
|
||||
|
||||
RsChatSerialiser *_serializer ;
|
||||
RsChatSerialiser *_serializer ;
|
||||
};
|
||||
|
||||
class p3ChatService::StateStringInfo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue