mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
improvement MessagesDialog:
- enabled draft box bugfix MessagesDialog: - correct from and to in list and message header changes MessageComposer: - cleaned channel part git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2994 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dba460ce0c
commit
b0c1467abe
16 changed files with 281 additions and 242 deletions
|
@ -124,6 +124,8 @@ virtual bool getMessage(std::string mId, MessageInfo &msg) = 0;
|
|||
virtual void getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox) = 0;
|
||||
|
||||
virtual bool MessageSend(MessageInfo &info) = 0;
|
||||
virtual bool MessageToDraft(MessageInfo &info) = 0;
|
||||
|
||||
virtual bool MessageDelete(std::string mid) = 0;
|
||||
virtual bool MessageRead(std::string mid) = 0;
|
||||
|
||||
|
|
|
@ -75,6 +75,11 @@ bool p3Msgs::MessageSend(MessageInfo &info)
|
|||
return mMsgSrv->MessageSend(info);
|
||||
}
|
||||
|
||||
bool p3Msgs::MessageToDraft(MessageInfo &info)
|
||||
{
|
||||
return mMsgSrv->MessageToDraft(info);
|
||||
}
|
||||
|
||||
/****************************************/
|
||||
/****************************************/
|
||||
bool p3Msgs::MessageDelete(std::string mid)
|
||||
|
|
|
@ -57,7 +57,8 @@ class p3Msgs: public RsMsgs
|
|||
virtual bool getMessage(std::string mId, MessageInfo &msg);
|
||||
virtual void getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox);
|
||||
|
||||
virtual bool MessageSend(MessageInfo &info);
|
||||
virtual bool MessageSend(MessageInfo &info);
|
||||
virtual bool MessageToDraft(MessageInfo &info);
|
||||
virtual bool MessageDelete(std::string mid);
|
||||
virtual bool MessageRead(std::string mid);
|
||||
|
||||
|
|
|
@ -264,9 +264,6 @@ int p3MsgService::checkOutgoingMessages()
|
|||
|
||||
bool p3MsgService::saveConfiguration()
|
||||
{
|
||||
std::list<std::string>::iterator it;
|
||||
std::string empty("");
|
||||
|
||||
pqioutput(PQL_DEBUG_BASIC, msgservicezone,
|
||||
"p3MsgService::save_config()");
|
||||
|
||||
|
@ -309,8 +306,6 @@ bool p3MsgService::saveConfiguration()
|
|||
|
||||
bool p3MsgService::loadConfiguration(std::string &loadHash)
|
||||
{
|
||||
std::list<std::string>::iterator it;
|
||||
|
||||
std::string msgfile = Filename();
|
||||
|
||||
RsSerialiser *rss = new RsSerialiser();
|
||||
|
@ -659,6 +654,51 @@ bool p3MsgService::MessageSend(MessageInfo &info)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool p3MsgService::MessageToDraft(MessageInfo &info)
|
||||
{
|
||||
RsMsgItem *msg = initMIRsMsg(info, mConnMgr->getOwnId());
|
||||
if (msg)
|
||||
{
|
||||
uint32_t msgId = 0;
|
||||
if (info.msgId.empty() == false) {
|
||||
std::istringstream instream(info.msgId);
|
||||
instream >> msgId;
|
||||
}
|
||||
|
||||
if (msgId) {
|
||||
msg->msgId = msgId;
|
||||
} else {
|
||||
msg->msgId = getNewUniqueMsgId(); /* grabs Mtx as well */
|
||||
}
|
||||
|
||||
{
|
||||
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
/* add pending flag */
|
||||
msg->msgFlags |= (RS_MSG_OUTGOING | RS_MSG_FLAGS_DRAFT);
|
||||
|
||||
if (msgId) {
|
||||
// remove existing message
|
||||
RsMsgItem *existingMsg = imsg[msgId];
|
||||
if (existingMsg) {
|
||||
delete (existingMsg);
|
||||
}
|
||||
imsg.erase(msgId);
|
||||
}
|
||||
/* STORE MsgID */
|
||||
imsg[msg->msgId] = msg;
|
||||
}
|
||||
|
||||
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
|
||||
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_MOD);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/****************************************/
|
||||
/****************************************/
|
||||
|
||||
|
@ -686,7 +726,11 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi)
|
|||
{
|
||||
mi.msgflags |= RS_MSG_PENDING;
|
||||
}
|
||||
if (msg->msgFlags & RS_MSG_FLAGS_NEW)
|
||||
if (msg->msgFlags & RS_MSG_FLAGS_DRAFT)
|
||||
{
|
||||
mi.msgflags |= RS_MSG_DRAFT;
|
||||
}
|
||||
if (msg->msgFlags & RS_MSG_FLAGS_NEW)
|
||||
{
|
||||
mi.msgflags |= RS_MSG_NEW;
|
||||
}
|
||||
|
@ -761,7 +805,11 @@ void p3MsgService::initRsMIS(RsMsgItem *msg, MsgInfoSummary &mis)
|
|||
{
|
||||
mis.msgflags |= RS_MSG_PENDING;
|
||||
}
|
||||
if (msg->msgFlags & RS_MSG_FLAGS_NEW)
|
||||
if (msg->msgFlags & RS_MSG_FLAGS_DRAFT)
|
||||
{
|
||||
mis.msgflags |= RS_MSG_DRAFT;
|
||||
}
|
||||
if (msg->msgFlags & RS_MSG_FLAGS_NEW)
|
||||
{
|
||||
mis.msgflags |= RS_MSG_NEW;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ bool removeMsgId(std::string mid);
|
|||
bool markMsgIdRead(std::string mid);
|
||||
|
||||
bool MessageSend(MessageInfo &info);
|
||||
bool MessageToDraft(MessageInfo &info);
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue