Added a star column for messages.

Recompile of the gui needed.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4217 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-05-23 23:45:31 +00:00
parent 3f21835114
commit c45e7562bb
12 changed files with 800 additions and 370 deletions

View file

@ -52,6 +52,7 @@
#define RS_MSG_UNREAD_BY_USER 0x0040 /* Unread by user */
#define RS_MSG_REPLIED 0x0080 /* Message is replied */
#define RS_MSG_FORWARDED 0x0100 /* Message is forwarded */
#define RS_MSG_STAR 0x0200 /* Message is marked with a star */
#define RS_MSGTAGTYPE_IMPORTANT 1
#define RS_MSGTAGTYPE_WORK 2
@ -163,9 +164,10 @@ virtual bool MessageToTrash(const std::string &mid, bool bTrash) = 0;
virtual bool getMsgParentId(const std::string &msgId, std::string &msgParentId) = 0;
virtual bool MessageDelete(const std::string &mid) = 0;
virtual bool MessageRead(const std::string &mid, bool bUnreadByUser) = 0;
virtual bool MessageRead(const std::string &mid, bool unreadByUser) = 0;
virtual bool MessageReplied(const std::string &mid, bool replied) = 0;
virtual bool MessageForwarded(const std::string &mid, bool forwarded) = 0;
virtual bool MessageStar(const std::string &mid, bool mark) = 0;
/* message tagging */

View file

@ -100,12 +100,12 @@ bool p3Msgs::MessageDelete(const std::string &mid)
return mMsgSrv -> removeMsgId(mid);
}
bool p3Msgs::MessageRead(const std::string &mid, bool bUnreadByUser)
bool p3Msgs::MessageRead(const std::string &mid, bool unreadByUser)
{
//std::cerr << "p3Msgs::MessageRead() ";
//std::cerr << "mid: " << mid << std::endl;
return mMsgSrv -> markMsgIdRead(mid, bUnreadByUser);
return mMsgSrv -> markMsgIdRead(mid, unreadByUser);
}
bool p3Msgs::MessageReplied(const std::string &mid, bool replied)
@ -123,6 +123,12 @@ bool p3Msgs::getMessageTagTypes(MsgTagType& tags)
return mMsgSrv->getMessageTagTypes(tags);
}
bool p3Msgs::MessageStar(const std::string &mid, bool star)
{
return mMsgSrv->setMsgFlag(mid, star ? RS_MSG_FLAGS_STAR : 0, RS_MSG_FLAGS_STAR);
}
bool p3Msgs::setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color)
{
return mMsgSrv->setMessageTagType(tagId, text, rgb_color);

View file

@ -61,9 +61,10 @@ class p3Msgs: public RsMsgs
virtual bool MessageToDraft(MessageInfo &info, const std::string &msgParentId);
virtual bool MessageToTrash(const std::string &mid, bool bTrash);
virtual bool MessageDelete(const std::string &mid);
virtual bool MessageRead(const std::string &mid, bool bUnreadByUser);
virtual bool MessageRead(const std::string &mid, bool unreadByUser);
virtual bool MessageReplied(const std::string &mid, bool replied);
virtual bool MessageForwarded(const std::string &mid, bool forwarded);
virtual bool MessageStar(const std::string &mid, bool star);
virtual bool getMsgParentId(const std::string &msgId, std::string &msgParentId);
virtual bool getMessageTagTypes(MsgTagType& tags);

View file

@ -188,6 +188,7 @@ const uint32_t RS_MSG_FLAGS_TRASH = 0x0020;
const uint32_t RS_MSG_FLAGS_UNREAD_BY_USER = 0x0040;
const uint32_t RS_MSG_FLAGS_REPLIED = 0x0080;
const uint32_t RS_MSG_FLAGS_FORWARDED = 0x0100;
const uint32_t RS_MSG_FLAGS_STAR = 0x0200;
class RsMsgItem: public RsItem
{

View file

@ -683,7 +683,7 @@ bool p3MsgService::removeMsgId(const std::string &mid)
return changed;
}
bool p3MsgService::markMsgIdRead(const std::string &mid, bool bUnreadByUser)
bool p3MsgService::markMsgIdRead(const std::string &mid, bool unreadByUser)
{
std::map<uint32_t, RsMsgItem *>::iterator mit;
uint32_t msgId = atoi(mid.c_str());
@ -703,7 +703,7 @@ bool p3MsgService::markMsgIdRead(const std::string &mid, bool bUnreadByUser)
mi->msgFlags &= ~(RS_MSG_FLAGS_NEW);
/* set state from user */
if (bUnreadByUser) {
if (unreadByUser) {
mi->msgFlags |= RS_MSG_FLAGS_UNREAD_BY_USER;
} else {
mi->msgFlags &= ~RS_MSG_FLAGS_UNREAD_BY_USER;
@ -1311,6 +1311,10 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi)
{
mi.msgflags |= RS_MSG_FORWARDED;
}
if (msg->msgFlags & RS_MSG_FLAGS_STAR)
{
mi.msgflags |= RS_MSG_STAR;
}
mi.ts = msg->sendTime;
mi.srcId = msg->PeerId();
@ -1406,6 +1410,10 @@ void p3MsgService::initRsMIS(RsMsgItem *msg, MsgInfoSummary &mis)
{
mis.msgflags |= RS_MSG_FORWARDED;
}
if (msg->msgFlags & RS_MSG_FLAGS_STAR)
{
mis.msgflags |= RS_MSG_STAR;
}
mis.srcId = msg->PeerId();
{