Added receive time to ChatInfo - recompile of gui needed.

Use receive time for chat information to have the right order in the history (problem of time zones and wrong clocks).

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3593 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-10-03 10:08:58 +00:00
parent 7664a82fd6
commit cfa10c6f80
12 changed files with 42 additions and 30 deletions

View file

@ -128,6 +128,7 @@ class ChatInfo
std::string rsid;
unsigned int chatflags;
uint32_t sendTime;
uint32_t recvTime;
std::wstring msg;
};

View file

@ -89,6 +89,7 @@ int p3ChatService::sendPublicChat(std::wstring &msg)
ci->PeerId(*it);
ci->chatFlags = 0;
ci->sendTime = time(NULL);
ci->recvTime = ci->sendTime;
ci->message = msg;
#ifdef CHAT_DEBUG
@ -216,6 +217,7 @@ bool p3ChatService::sendPrivateChat(std::string &id, std::wstring &msg)
ci->PeerId(id);
ci->chatFlags = RS_CHAT_FLAG_PRIVATE;
ci->sendTime = time(NULL);
ci->recvTime = ci->sendTime;
ci->message = msg;
if (!mConnMgr->isOnline(id)) {
@ -599,7 +601,8 @@ void p3ChatService::initRsChatInfo(RsChatMsgItem *c, ChatInfo &i)
{
i.rsid = c->PeerId();
i.chatflags = 0;
i.sendTime =c->sendTime;
i.sendTime = c->sendTime;
i.recvTime = c->recvTime;
i.msg = c->message;
if (c -> chatFlags & RS_CHAT_FLAG_PRIVATE)