Fixed private message notification. Remove offline private messages of none friends at startup and when a friend is removed.

Moved the removing of the history of removed friends from p3PeerMgrIMPL to p3ChatService.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4940 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-02-14 22:55:14 +00:00
parent 9c5e4636c2
commit a2982f3370
6 changed files with 31 additions and 26 deletions

View file

@ -1387,7 +1387,7 @@ bool p3NetMgrIMPL::netAssistConnectShutdown()
return true;
}
bool p3NetMgrIMPL::netAssistFriend(std::string id, bool on)
bool p3NetMgrIMPL::netAssistFriend(const std::string &id, bool on)
{
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;
@ -1407,7 +1407,7 @@ bool p3NetMgrIMPL::netAssistFriend(std::string id, bool on)
}
bool p3NetMgrIMPL::netAssistKnownPeer(std::string id, const struct sockaddr_in &addr, uint32_t flags)
bool p3NetMgrIMPL::netAssistKnownPeer(const std::string &id, const struct sockaddr_in &addr, uint32_t flags)
{
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;
@ -1458,7 +1458,7 @@ bool p3NetMgrIMPL::netAssistAttach(bool on)
bool p3NetMgrIMPL::netAssistStatusUpdate(std::string id, int state)
bool p3NetMgrIMPL::netAssistStatusUpdate(const std::string &id, int state)
{
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;

View file

@ -118,10 +118,10 @@ virtual bool setNetworkMode(uint32_t netMode) = 0;
virtual bool setVisState(uint32_t visState) = 0;
// Switch DHT On/Off.
virtual bool netAssistFriend(std::string id, bool on) = 0;
virtual bool netAssistKnownPeer(std::string id, const struct sockaddr_in &addr, uint32_t flags) = 0;
virtual bool netAssistFriend(const std::string &id, bool on) = 0;
virtual bool netAssistKnownPeer(const std::string &id, const struct sockaddr_in &addr, uint32_t flags) = 0;
virtual bool netAssistBadPeer(const struct sockaddr_in &addr, uint32_t reason, uint32_t flags, uint32_t age) = 0;
virtual bool netAssistStatusUpdate(std::string id, int mode) = 0;
virtual bool netAssistStatusUpdate(const std::string &id, int mode) = 0;
/* Get Network State */
virtual uint32_t getNetStateMode() = 0;
@ -174,10 +174,10 @@ virtual bool setNetworkMode(uint32_t netMode);
virtual bool setVisState(uint32_t visState);
// Switch DHT On/Off.
virtual bool netAssistFriend(std::string id, bool on);
virtual bool netAssistKnownPeer(std::string id, const struct sockaddr_in &addr, uint32_t flags);
virtual bool netAssistFriend(const std::string &id, bool on);
virtual bool netAssistKnownPeer(const std::string &id, const struct sockaddr_in &addr, uint32_t flags);
virtual bool netAssistBadPeer(const struct sockaddr_in &addr, uint32_t reason, uint32_t flags, uint32_t age);
virtual bool netAssistStatusUpdate(std::string id, int mode);
virtual bool netAssistStatusUpdate(const std::string &id, int mode);
/* Get Network State */
virtual uint32_t getNetStateMode();

View file

@ -112,7 +112,6 @@ p3PeerMgrIMPL::p3PeerMgrIMPL()
mLinkMgr = NULL;
mNetMgr = NULL;
mHistoryMgr = NULL;
/* setup basics of own state */
mOwnState.id = AuthSSL::getAuthSSL()->OwnId();
@ -135,11 +134,10 @@ p3PeerMgrIMPL::p3PeerMgrIMPL()
return;
}
void p3PeerMgrIMPL::setManagers(p3LinkMgrIMPL *linkMgr, p3NetMgrIMPL *netMgr, p3HistoryMgr *historyMgr)
void p3PeerMgrIMPL::setManagers(p3LinkMgrIMPL *linkMgr, p3NetMgrIMPL *netMgr)
{
mLinkMgr = linkMgr;
mNetMgr = netMgr;
mHistoryMgr = historyMgr;
}
void p3PeerMgrIMPL::setOwnNetworkMode(uint32_t netMode)
@ -564,7 +562,6 @@ bool p3PeerMgrIMPL::removeFriend(const std::string &id)
{
if (mFriendList.end() != (it = mFriendList.find(*rit)))
{
mHistoryMgr->clear(it->second.id);
mFriendList.erase(it);
}
}

View file

@ -113,7 +113,6 @@ class p3NetMgr;
class p3LinkMgrIMPL;
class p3NetMgrIMPL;
class p3HistoryMgr;
class p3PeerMgr
{
@ -284,7 +283,7 @@ virtual bool haveOnceConnected();
p3PeerMgrIMPL();
void setManagers(p3LinkMgrIMPL *linkMgr, p3NetMgrIMPL *netMgr, p3HistoryMgr *historyMgr);
void setManagers(p3LinkMgrIMPL *linkMgr, p3NetMgrIMPL *netMgr);
void tick();
@ -319,7 +318,6 @@ void printPeerLists(std::ostream &out);
p3LinkMgrIMPL *mLinkMgr;
p3NetMgrIMPL *mNetMgr;
p3HistoryMgr *mHistoryMgr;
private:
RsMutex mPeerMtx; /* protects below */