Friend recommendation message

- renamed subject
- added to system message
Recompile needed


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5145 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-05-05 22:20:05 +00:00
parent 1b80207fbe
commit b81a911793
11 changed files with 107 additions and 69 deletions

View file

@ -48,15 +48,16 @@
#define RS_MSG_OUTBOX 0x03 /* Outbox */
#define RS_MSG_DRAFTBOX 0x05 /* Draftbox */
#define RS_MSG_NEW 0x0010 /* New */
#define RS_MSG_TRASH 0x0020 /* Trash */
#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_MSG_NEW 0x0010 /* New */
#define RS_MSG_TRASH 0x0020 /* Trash */
#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 */
// system message
#define RS_MSG_USER_REQUEST 0x0400 /* user request */
#define RS_MSG_SYSTEM (RS_MSG_USER_REQUEST)
#define RS_MSG_USER_REQUEST 0x0400 /* user request */
#define RS_MSG_FRIEND_RECOMMENDATION 0x0800 /* friend recommendation */
#define RS_MSG_SYSTEM (RS_MSG_USER_REQUEST | RS_MSG_FRIEND_RECOMMENDATION)
#define RS_CHAT_LOBBY_EVENT_PEER_LEFT 0x01
#define RS_CHAT_LOBBY_EVENT_PEER_STATUS 0x02

View file

@ -351,19 +351,20 @@ class RsChatSerialiser: public RsSerialType
/**************************************************************************/
const uint32_t RS_MSG_FLAGS_OUTGOING = 0x0001;
const uint32_t RS_MSG_FLAGS_PENDING = 0x0002;
const uint32_t RS_MSG_FLAGS_DRAFT = 0x0004;
const uint32_t RS_MSG_FLAGS_NEW = 0x0010;
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;
const uint32_t RS_MSG_FLAGS_PARTIAL = 0x0400;
const uint32_t RS_MSG_FLAGS_OUTGOING = 0x0001;
const uint32_t RS_MSG_FLAGS_PENDING = 0x0002;
const uint32_t RS_MSG_FLAGS_DRAFT = 0x0004;
const uint32_t RS_MSG_FLAGS_NEW = 0x0010;
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;
const uint32_t RS_MSG_FLAGS_PARTIAL = 0x0400;
// system message
const uint32_t RS_MSG_FLAGS_USER_REQUEST = 0x0800;
const uint32_t RS_MSG_FLAGS_SYSTEM = RS_MSG_FLAGS_USER_REQUEST;
const uint32_t RS_MSG_FLAGS_USER_REQUEST = 0x0800;
const uint32_t RS_MSG_FLAGS_FRIEND_RECOMMENDATION = 0x1000;
const uint32_t RS_MSG_FLAGS_SYSTEM = RS_MSG_FLAGS_USER_REQUEST | RS_MSG_FLAGS_FRIEND_RECOMMENDATION;
class RsMsgItem: public RsItem
{

View file

@ -954,6 +954,9 @@ bool p3MsgService::SystemMessage(const std::wstring &title, const std::wstring &
if (systemFlag & RS_MSG_USER_REQUEST) {
msg->msgFlags |= RS_MSG_FLAGS_USER_REQUEST;
}
if (systemFlag & RS_MSG_FRIEND_RECOMMENDATION) {
msg->msgFlags |= RS_MSG_FLAGS_FRIEND_RECOMMENDATION;
}
msg->msgId = 0;
msg->sendTime = time(NULL);
@ -1378,6 +1381,10 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi)
{
mi.msgflags |= RS_MSG_USER_REQUEST;
}
if (msg->msgFlags & RS_MSG_FLAGS_FRIEND_RECOMMENDATION)
{
mi.msgflags |= RS_MSG_FRIEND_RECOMMENDATION;
}
mi.ts = msg->sendTime;
mi.srcId = msg->PeerId();
@ -1478,6 +1485,10 @@ void p3MsgService::initRsMIS(RsMsgItem *msg, MsgInfoSummary &mis)
{
mis.msgflags |= RS_MSG_USER_REQUEST;
}
if (msg->msgFlags & RS_MSG_FLAGS_FRIEND_RECOMMENDATION)
{
mis.msgflags |= RS_MSG_FRIEND_RECOMMENDATION;
}
mis.srcId = msg->PeerId();
{
@ -1542,6 +1553,10 @@ RsMsgItem *p3MsgService::initMIRsMsg(MessageInfo &info, const std::string &to)
{
msg->msgFlags |= RS_MSG_FLAGS_USER_REQUEST;
}
if (info.msgflags & RS_MSG_FRIEND_RECOMMENDATION)
{
msg->msgFlags |= RS_MSG_FLAGS_FRIEND_RECOMMENDATION;
}
//std::cerr << "p3MsgService::initMIRsMsg()" << std::endl;
//msg->print(std::cerr);