mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 01:16:20 -05:00
Modify Messages with additional namespace - to allow switching to new Mail.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8066 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bd2026458e
commit
7cece484c4
@ -103,6 +103,12 @@ typedef RsPeerId DistantChatPeerId ;
|
||||
|
||||
typedef uint64_t MessageId ;
|
||||
|
||||
|
||||
namespace Rs
|
||||
{
|
||||
namespace Msgs
|
||||
{
|
||||
|
||||
class MsgAddress
|
||||
{
|
||||
public:
|
||||
@ -238,6 +244,10 @@ public:
|
||||
|
||||
};
|
||||
|
||||
} //namespace Rs
|
||||
} //namespace Msgs
|
||||
|
||||
|
||||
#define RS_CHAT_PUBLIC 0x0001
|
||||
#define RS_CHAT_PRIVATE 0x0002
|
||||
#define RS_CHAT_AVATAR_AVAILABLE 0x0004
|
||||
@ -370,7 +380,7 @@ struct DistantChatInviteInfo
|
||||
uint32_t invite_flags ; // used to keep track of wether signature was ok or not.
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const MessageInfo &info);
|
||||
std::ostream &operator<<(std::ostream &out, const Rs::Msgs::MessageInfo &info);
|
||||
|
||||
class RsMsgs;
|
||||
extern RsMsgs *rsMsgs;
|
||||
@ -386,13 +396,13 @@ virtual ~RsMsgs() { return; }
|
||||
/* Message Items */
|
||||
/****************************************/
|
||||
|
||||
virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList) = 0;
|
||||
virtual bool getMessage(const std::string &mId, MessageInfo &msg) = 0;
|
||||
virtual bool getMessageSummaries(std::list<Rs::Msgs::MsgInfoSummary> &msgList) = 0;
|
||||
virtual bool getMessage(const std::string &mId, Rs::Msgs::MessageInfo &msg) = 0;
|
||||
virtual void getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox, unsigned int *pnTrashbox) = 0;
|
||||
|
||||
virtual bool MessageSend(MessageInfo &info) = 0;
|
||||
virtual bool MessageSend(Rs::Msgs::MessageInfo &info) = 0;
|
||||
virtual bool SystemMessage(const std::string &title, const std::string &message, uint32_t systemFlag) = 0;
|
||||
virtual bool MessageToDraft(MessageInfo &info, const std::string &msgParentId) = 0;
|
||||
virtual bool MessageToDraft(Rs::Msgs::MessageInfo &info, const std::string &msgParentId) = 0;
|
||||
virtual bool MessageToTrash(const std::string &mid, bool bTrash) = 0;
|
||||
virtual bool getMsgParentId(const std::string &msgId, std::string &msgParentId) = 0;
|
||||
|
||||
@ -405,15 +415,15 @@ virtual bool MessageLoadEmbeddedImages(const std::string &mid, bool load) = 0;
|
||||
|
||||
/* message tagging */
|
||||
|
||||
virtual bool getMessageTagTypes(MsgTagType& tags) = 0;
|
||||
virtual bool getMessageTagTypes(Rs::Msgs::MsgTagType& tags) = 0;
|
||||
/* set == false && tagId == 0 --> remove all */
|
||||
virtual bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color) = 0;
|
||||
virtual bool removeMessageTagType(uint32_t tagId) = 0;
|
||||
|
||||
virtual bool getMessageTag(const std::string &msgId, MsgTagInfo& info) = 0;
|
||||
virtual bool getMessageTag(const std::string &msgId, Rs::Msgs::MsgTagInfo& info) = 0;
|
||||
virtual bool setMessageTag(const std::string &msgId, uint32_t tagId, bool set) = 0;
|
||||
|
||||
virtual bool resetMessageStandardTagTypes(MsgTagType& tags) = 0;
|
||||
virtual bool resetMessageStandardTagTypes(Rs::Msgs::MsgTagType& tags) = 0;
|
||||
|
||||
/****************************************/
|
||||
/* Private distant messages */
|
||||
|
@ -127,8 +127,6 @@ class RsServer: public RsControl, public RsThread
|
||||
|
||||
private:
|
||||
|
||||
void initRsMI(RsMsgItem *msg, MessageInfo &mi);
|
||||
|
||||
/****************************************/
|
||||
/****************************************/
|
||||
/****************************************/
|
||||
|
@ -43,6 +43,8 @@ const int p3facemsgzone = 11453;
|
||||
|
||||
#include "pqi/authgpg.h"
|
||||
|
||||
using namespace Rs::Msgs;
|
||||
|
||||
/* external reference point */
|
||||
RsMsgs *rsMsgs = NULL;
|
||||
|
||||
|
@ -54,13 +54,13 @@ class p3Msgs: public RsMsgs
|
||||
/*!
|
||||
* @param msgList ref to list summarising client's msgs
|
||||
*/
|
||||
virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList);
|
||||
virtual bool getMessage(const std::string &mId, MessageInfo &msg);
|
||||
virtual bool getMessageSummaries(std::list<Rs::Msgs::MsgInfoSummary> &msgList);
|
||||
virtual bool getMessage(const std::string &mId, Rs::Msgs::MessageInfo &msg);
|
||||
virtual void getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox, unsigned int *pnTrashbox);
|
||||
|
||||
virtual bool MessageSend(MessageInfo &info);
|
||||
virtual bool MessageSend(Rs::Msgs::MessageInfo &info);
|
||||
virtual bool SystemMessage(const std::string &title, const std::string &message, uint32_t systemFlag);
|
||||
virtual bool MessageToDraft(MessageInfo &info, const std::string &msgParentId);
|
||||
virtual bool MessageToDraft(Rs::Msgs::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 unreadByUser);
|
||||
@ -70,15 +70,15 @@ class p3Msgs: public RsMsgs
|
||||
virtual bool MessageLoadEmbeddedImages(const std::string &mid, bool load);
|
||||
virtual bool getMsgParentId(const std::string &msgId, std::string &msgParentId);
|
||||
|
||||
virtual bool getMessageTagTypes(MsgTagType& tags);
|
||||
virtual bool getMessageTagTypes(Rs::Msgs::MsgTagType& tags);
|
||||
virtual bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color);
|
||||
virtual bool removeMessageTagType(uint32_t tagId);
|
||||
|
||||
virtual bool getMessageTag(const std::string &msgId, MsgTagInfo& info);
|
||||
virtual bool getMessageTag(const std::string &msgId, Rs::Msgs::MsgTagInfo& info);
|
||||
/* set == false && tagId == 0 --> remove all */
|
||||
virtual bool setMessageTag(const std::string &msgId, uint32_t tagId, bool set);
|
||||
|
||||
virtual bool resetMessageStandardTagTypes(MsgTagType& tags);
|
||||
virtual bool resetMessageStandardTagTypes(Rs::Msgs::MsgTagType& tags);
|
||||
|
||||
virtual void enableDistantMessaging(bool b) ;
|
||||
virtual bool distantMessagingEnabled() ;
|
||||
|
@ -91,10 +91,13 @@ const uint16_t RS_SERVICE_TYPE_RTT = 0x1011;
|
||||
/***************** IDS ALLOCATED FOR PLUGINS ******************/
|
||||
// 2000+
|
||||
|
||||
const uint16_t RS_SERVICE_TYPE_PLUGIN_ARADO_ID = 0x2001;
|
||||
const uint16_t RS_SERVICE_TYPE_PLUGIN_QCHESS_ID = 0x2002;
|
||||
const uint16_t RS_SERVICE_TYPE_PLUGIN_FEEDREADER = 0x2003;
|
||||
const uint16_t RS_SERVICE_TYPE_PLUGIN_ARADO_ID = 0x2001;
|
||||
const uint16_t RS_SERVICE_TYPE_PLUGIN_QCHESS_ID = 0x2002;
|
||||
const uint16_t RS_SERVICE_TYPE_PLUGIN_FEEDREADER = 0x2003;
|
||||
|
||||
// Nabu's services.
|
||||
const uint16_t RS_SERVICE_TYPE_PLUGIN_FIDO_GW = 0xF1D0;
|
||||
const uint16_t RS_SERVICE_TYPE_PLUGIN_ZERORESERVE = 0xBEEF;
|
||||
|
||||
/****************** BELOW ARE ONLY THEORETICAL (CAN BE CHANGED) *****/
|
||||
/*
|
||||
|
@ -63,6 +63,8 @@
|
||||
//#define DISABLE_DISTANT_MESSAGES
|
||||
//#define DEBUG_DISTANT_MSG
|
||||
|
||||
using namespace Rs::Msgs;
|
||||
|
||||
const int msgservicezone = 54319;
|
||||
|
||||
/* Another little hack ..... unique message Ids
|
||||
@ -1500,6 +1502,10 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi)
|
||||
|
||||
mi.title = msg->subject;
|
||||
mi.msg = msg->message;
|
||||
{
|
||||
//msg->msgId;
|
||||
rs_sprintf(mi.msgId, "%lu", msg->msgId);
|
||||
}
|
||||
|
||||
mi.attach_title = msg->attachment.title;
|
||||
mi.attach_comment = msg->attachment.comment;
|
||||
|
@ -61,8 +61,8 @@ class p3MsgService: public p3Service, public p3Config, public pqiServiceMonitor,
|
||||
virtual RsServiceInfo getServiceInfo();
|
||||
|
||||
/* External Interface */
|
||||
bool getMessageSummaries(std::list<MsgInfoSummary> &msgList);
|
||||
bool getMessage(const std::string &mid, MessageInfo &msg);
|
||||
bool getMessageSummaries(std::list<Rs::Msgs::MsgInfoSummary> &msgList);
|
||||
bool getMessage(const std::string &mid, Rs::Msgs::MessageInfo &msg);
|
||||
void getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox, unsigned int *pnTrashbox);
|
||||
|
||||
bool decryptMessage(const std::string& mid) ;
|
||||
@ -73,20 +73,20 @@ class p3MsgService: public p3Service, public p3Config, public pqiServiceMonitor,
|
||||
// msgParentId == 0 --> remove
|
||||
bool setMsgParentId(uint32_t msgId, uint32_t msgParentId);
|
||||
|
||||
bool MessageSend(MessageInfo &info);
|
||||
bool MessageSend(Rs::Msgs::MessageInfo &info);
|
||||
bool SystemMessage(const std::string &title, const std::string &message, uint32_t systemFlag);
|
||||
bool MessageToDraft(MessageInfo &info, const std::string &msgParentId);
|
||||
bool MessageToDraft(Rs::Msgs::MessageInfo &info, const std::string &msgParentId);
|
||||
bool MessageToTrash(const std::string &mid, bool bTrash);
|
||||
|
||||
bool getMessageTagTypes(MsgTagType& tags);
|
||||
bool getMessageTagTypes(Rs::Msgs::MsgTagType& tags);
|
||||
bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color);
|
||||
bool removeMessageTagType(uint32_t tagId);
|
||||
|
||||
bool getMessageTag(const std::string &msgId, MsgTagInfo& info);
|
||||
bool getMessageTag(const std::string &msgId, Rs::Msgs::MsgTagInfo& info);
|
||||
/* set == false && tagId == 0 --> remove all */
|
||||
bool setMessageTag(const std::string &msgId, uint32_t tagId, bool set);
|
||||
|
||||
bool resetMessageStandardTagTypes(MsgTagType& tags);
|
||||
bool resetMessageStandardTagTypes(Rs::Msgs::MsgTagType& tags);
|
||||
|
||||
void loadWelcomeMsg(); /* startup message */
|
||||
|
||||
@ -158,12 +158,12 @@ class p3MsgService: public p3Service, public p3Config, public pqiServiceMonitor,
|
||||
void processMsg(RsMsgItem *mi, bool incoming);
|
||||
bool checkAndRebuildPartialMessage(RsMsgItem*) ;
|
||||
|
||||
void initRsMI(RsMsgItem *msg, MessageInfo &mi);
|
||||
void initRsMIS(RsMsgItem *msg, MsgInfoSummary &mis);
|
||||
void initRsMI(RsMsgItem *msg, Rs::Msgs::MessageInfo &mi);
|
||||
void initRsMIS(RsMsgItem *msg, Rs::Msgs::MsgInfoSummary &mis);
|
||||
|
||||
RsMsgItem *initMIRsMsg(const MessageInfo &info, const RsPeerId& to);
|
||||
RsMsgItem *initMIRsMsg(const MessageInfo &info, const RsGxsId& to);
|
||||
void initMIRsMsg(RsMsgItem *item,const MessageInfo &info) ;
|
||||
RsMsgItem *initMIRsMsg(const Rs::Msgs::MessageInfo &info, const RsPeerId& to);
|
||||
RsMsgItem *initMIRsMsg(const Rs::Msgs::MessageInfo &info, const RsGxsId& to);
|
||||
void initMIRsMsg(RsMsgItem *item,const Rs::Msgs::MessageInfo &info) ;
|
||||
|
||||
void initStandardTagTypes();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user