Removed methods on RsControl for handling id's of chat and messages.

Now the user can write mail messages and two or more parallel MessageComposer's.
Recompile needed.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3534 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-09-24 11:38:46 +00:00
parent 752495d239
commit 789ca4ff6b
7 changed files with 73 additions and 271 deletions

View file

@ -39,118 +39,6 @@ const int p3facemsgzone = 11453;
/* Flagging Persons / Channels / Files in or out of a set (CheckLists) */
int RsServer::ClearInChat()
{
lockRsCore(); /* LOCK */
mInChatList.clear();
unlockRsCore(); /* UNLOCK */
return 1;
}
/* Flagging Persons / Channels / Files in or out of a set (CheckLists) */
int RsServer::SetInChat(std::string id, bool in) /* friend : chat msgs */
{
/* so we send this.... */
lockRsCore(); /* LOCK */
//std::cerr << "Set InChat(" << id << ") to " << (in ? "True" : "False") << std::endl;
std::list<std::string>::iterator it;
it = std::find(mInChatList.begin(), mInChatList.end(), id);
if (it == mInChatList.end())
{
if (in)
{
mInChatList.push_back(id);
}
}
else
{
if (!in)
{
mInChatList.erase(it);
}
}
unlockRsCore(); /* UNLOCK */
return 1;
}
int RsServer::ClearInMsg()
{
lockRsCore(); /* LOCK */
mInMsgList.clear();
unlockRsCore(); /* UNLOCK */
return 1;
}
int RsServer::SetInMsg(std::string id, bool in) /* friend : msgs */
{
/* so we send this.... */
lockRsCore(); /* LOCK */
//std::cerr << "Set InMsg(" << id << ") to " << (in ? "True" : "False") << std::endl;
std::list<std::string>::iterator it;
it = std::find(mInMsgList.begin(), mInMsgList.end(), id);
if (it == mInMsgList.end())
{
if (in)
{
mInMsgList.push_back(id);
}
}
else
{
if (!in)
{
mInMsgList.erase(it);
}
}
unlockRsCore(); /* UNLOCK */
return 1;
}
bool RsServer::IsInChat(std::string id) /* friend : chat msgs */
{
/* so we send this.... */
lockRsCore(); /* LOCK */
std::list<std::string>::iterator it;
it = std::find(mInChatList.begin(), mInChatList.end(), id);
bool inChat = (it != mInChatList.end());
unlockRsCore(); /* UNLOCK */
return inChat;
}
bool RsServer::IsInMsg(std::string id) /* friend : msg recpts*/
{
/* so we send this.... */
lockRsCore(); /* LOCK */
std::list<std::string>::iterator it;
it = std::find(mInMsgList.begin(), mInMsgList.end(), id);
bool inMsg = (it != mInMsgList.end());
unlockRsCore(); /* UNLOCK */
return inMsg;
}
int RsServer::ClearInBroadcast()
{
@ -171,53 +59,3 @@ int RsServer::SetInSubscribe(std::string id, bool in) /* channel : su
{
return 1;
}
int RsServer::ClearInRecommend()
{
/* find in people ... set chat flag */
RsIface &iface = getIface();
iface.lockData(); /* LOCK IFACE */
std::list<FileInfo> &recs = iface.mRecommendList;
std::list<FileInfo>::iterator it;
for(it = recs.begin(); it != recs.end(); it++)
{
it -> inRecommend = false;
}
iface.unlockData(); /* UNLOCK IFACE */
return 1;
}
int RsServer::SetInRecommend(std::string id, bool in) /* file : recommended file */
{
/* find in people ... set chat flag */
RsIface &iface = getIface();
iface.lockData(); /* LOCK IFACE */
std::list<FileInfo> &recs = iface.mRecommendList;
std::list<FileInfo>::iterator it;
for(it = recs.begin(); it != recs.end(); it++)
{
if (it -> fname == id)
{
/* set flag */
it -> inRecommend = in;
//std::cerr << "Set InRecommend (" << id << ") to " << (in ? "True" : "False") << std::endl;
}
}
iface.unlockData(); /* UNLOCK IFACE */
return 1;
}