Added read/unread state to channel service (copied from forum service).

Added new and missing tests of the RsItems.
Added new notifier on channel changes.
Reworked fill of channels in ChannelFeed. Now the channel tree is updated and not refilled.
Show unread message count in channels tree.
Fixed memory leak in context menu.
Show a new tray icon and action icon in MainWindow, when new channel messages are available.

Recompile of the GUI needed.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3626 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-10-07 00:17:42 +00:00
parent df20d69b29
commit fc0ff38206
22 changed files with 1181 additions and 653 deletions

View file

@ -42,6 +42,18 @@ RsSerialType* init_item(RsChatMsgItem& cmi)
return new RsChatSerialiser();
}
RsSerialType* init_item(RsPrivateChatMsgConfigItem& pcmi)
{
randString(SHORT_STR, pcmi.configPeerId);
pcmi.chatFlags = rand()%34;
pcmi.configFlags = rand()%21;
pcmi.sendTime = rand()%422224;
randString(LARGE_STR, pcmi.message);
pcmi.recvTime = rand()%344443;
return new RsChatSerialiser();
}
RsSerialType* init_item(RsChatStatusItem& csi)
{
@ -123,6 +135,19 @@ bool operator ==(const RsChatMsgItem& cmiLeft,const RsChatMsgItem& cmiRight)
return true;
}
bool operator ==(const RsPrivateChatMsgConfigItem& pcmiLeft,const RsPrivateChatMsgConfigItem& pcmiRight)
{
if(pcmiLeft.configPeerId != pcmiRight.configPeerId) return false;
if(pcmiLeft.chatFlags != pcmiRight.chatFlags) return false;
if(pcmiLeft.configFlags != pcmiRight.configFlags) return false;
if(pcmiLeft.message != pcmiRight.message) return false;
if(pcmiLeft.sendTime != pcmiRight.sendTime) return false;
if(pcmiLeft.recvTime != pcmiRight.recvTime) return false;
return true;
}
bool operator ==(const RsChatStatusItem& csiLeft, const RsChatStatusItem& csiRight)
{
if(csiLeft.flags != csiRight.flags) return false;
@ -201,6 +226,7 @@ bool operator ==(const RsMsgSrcId& msLeft, const RsMsgSrcId& msRight)
int main()
{
test_RsItem<RsChatMsgItem >(); REPORT("Serialise/Deserialise RsChatMsgItem");
test_RsItem<RsChatMsgItem >(); REPORT("Serialise/Deserialise RsPrivateChatMsgConfigItem");
test_RsItem<RsChatStatusItem >(); REPORT("Serialise/Deserialise RsChatStatusItem");
test_RsItem<RsChatAvatarItem >(); REPORT("Serialise/Deserialise RsChatAvatarItem");
test_RsItem<RsMsgItem >(); REPORT("Serialise/Deserialise RsMsgItem");