- Change methods of RsMsgs from "std::string" to "const std::string&"

- Fixed sent messages doesn't get the flag RS_MSG_FLAGS_NEW
- Rework reply and forward message, now the replied or forwarded message gets the state and not the answer itself
- Added RsMsgParentId (with test) to save the parent of the message in draft
- Change methods of MessageComposer from "std::string" to "QString"
- Show image in the message row in MessagesDialog again
- Fixed umlauts in recommended files in MessageComposer
- Renamed tab "Live Chat" in "Group Chat"
- Fixed german translation

recompile of the GUI needed

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3741 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-11-02 21:11:11 +00:00
parent 935903287d
commit 3c65283f8f
22 changed files with 820 additions and 382 deletions

View file

@ -50,6 +50,8 @@
#define RS_MSG_NEW 0x0010 /* New */ #define RS_MSG_NEW 0x0010 /* New */
#define RS_MSG_TRASH 0x0020 /* Trash */ #define RS_MSG_TRASH 0x0020 /* Trash */
#define RS_MSG_UNREAD_BY_USER 0x0040 /* Unread by user */ #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_MSGTAGTYPE_IMPORTANT 1 #define RS_MSGTAGTYPE_IMPORTANT 1
#define RS_MSGTAGTYPE_WORK 2 #define RS_MSGTAGTYPE_WORK 2
@ -152,15 +154,18 @@ virtual ~RsMsgs() { return; }
/* Message Items */ /* Message Items */
virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList) = 0; virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList) = 0;
virtual bool getMessage(std::string mId, MessageInfo &msg) = 0; virtual bool getMessage(const std::string &mId, 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 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(MessageInfo &info) = 0;
virtual bool MessageToDraft(MessageInfo &info) = 0; virtual bool MessageToDraft(MessageInfo &info, const std::string &msgParentId) = 0;
virtual bool MessageToTrash(std::string mid, bool bTrash) = 0; virtual bool MessageToTrash(const std::string &mid, bool bTrash) = 0;
virtual bool getMsgParentId(const std::string &msgId, std::string &msgParentId) = 0;
virtual bool MessageDelete(std::string mid) = 0; virtual bool MessageDelete(const std::string &mid) = 0;
virtual bool MessageRead(std::string mid, bool bUnreadByUser) = 0; virtual bool MessageRead(const std::string &mid, bool bUnreadByUser) = 0;
virtual bool MessageReplied(const std::string &mid, bool replied) = 0;
virtual bool MessageForwarded(const std::string &mid, bool forwarded) = 0;
/* message tagging */ /* message tagging */
@ -169,8 +174,8 @@ virtual bool getMessageTagTypes(MsgTagType& tags) = 0;
virtual bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color) = 0; virtual bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color) = 0;
virtual bool removeMessageTagType(uint32_t tagId) = 0; virtual bool removeMessageTagType(uint32_t tagId) = 0;
virtual bool getMessageTag(std::string msgId, MsgTagInfo& info) = 0; virtual bool getMessageTag(const std::string &msgId, MsgTagInfo& info) = 0;
virtual bool setMessageTag(std::string msgId, uint32_t tagId, bool set) = 0; virtual bool setMessageTag(const std::string &msgId, uint32_t tagId, bool set) = 0;
virtual bool resetMessageStandardTagTypes(MsgTagType& tags) = 0; virtual bool resetMessageStandardTagTypes(MsgTagType& tags) = 0;

View file

@ -57,7 +57,7 @@ bool p3Msgs::getMessageSummaries(std::list<MsgInfoSummary> &msgList)
bool p3Msgs::getMessage(std::string mid, MessageInfo &msg) bool p3Msgs::getMessage(const std::string &mid, MessageInfo &msg)
{ {
return mMsgSrv->getMessage(mid, msg); return mMsgSrv->getMessage(mid, msg);
} }
@ -75,19 +75,24 @@ bool p3Msgs::MessageSend(MessageInfo &info)
return mMsgSrv->MessageSend(info); return mMsgSrv->MessageSend(info);
} }
bool p3Msgs::MessageToDraft(MessageInfo &info) bool p3Msgs::MessageToDraft(MessageInfo &info, const std::string &msgParentId)
{ {
return mMsgSrv->MessageToDraft(info); return mMsgSrv->MessageToDraft(info, msgParentId);
} }
bool p3Msgs::MessageToTrash(std::string mid, bool bTrash) bool p3Msgs::MessageToTrash(const std::string &mid, bool bTrash)
{ {
return mMsgSrv->MessageToTrash(mid, bTrash); return mMsgSrv->MessageToTrash(mid, bTrash);
} }
bool p3Msgs::getMsgParentId(const std::string &msgId, std::string &msgParentId)
{
return mMsgSrv->getMsgParentId(msgId, msgParentId);
}
/****************************************/ /****************************************/
/****************************************/ /****************************************/
bool p3Msgs::MessageDelete(std::string mid) bool p3Msgs::MessageDelete(const std::string &mid)
{ {
//std::cerr << "p3Msgs::MessageDelete() "; //std::cerr << "p3Msgs::MessageDelete() ";
//std::cerr << "mid: " << mid << std::endl; //std::cerr << "mid: " << mid << std::endl;
@ -95,7 +100,7 @@ bool p3Msgs::MessageDelete(std::string mid)
return mMsgSrv -> removeMsgId(mid); return mMsgSrv -> removeMsgId(mid);
} }
bool p3Msgs::MessageRead(std::string mid, bool bUnreadByUser) bool p3Msgs::MessageRead(const std::string &mid, bool bUnreadByUser)
{ {
//std::cerr << "p3Msgs::MessageRead() "; //std::cerr << "p3Msgs::MessageRead() ";
//std::cerr << "mid: " << mid << std::endl; //std::cerr << "mid: " << mid << std::endl;
@ -103,6 +108,16 @@ bool p3Msgs::MessageRead(std::string mid, bool bUnreadByUser)
return mMsgSrv -> markMsgIdRead(mid, bUnreadByUser); return mMsgSrv -> markMsgIdRead(mid, bUnreadByUser);
} }
bool p3Msgs::MessageReplied(const std::string &mid, bool replied)
{
return mMsgSrv->setMsgFlag(mid, replied ? RS_MSG_FLAGS_REPLIED : 0, RS_MSG_FLAGS_REPLIED);
}
bool p3Msgs::MessageForwarded(const std::string &mid, bool forwarded)
{
return mMsgSrv->setMsgFlag(mid, forwarded ? RS_MSG_FLAGS_FORWARDED : 0, RS_MSG_FLAGS_FORWARDED);
}
bool p3Msgs::getMessageTagTypes(MsgTagType& tags) bool p3Msgs::getMessageTagTypes(MsgTagType& tags)
{ {
return mMsgSrv->getMessageTagTypes(tags); return mMsgSrv->getMessageTagTypes(tags);
@ -118,12 +133,12 @@ bool p3Msgs::removeMessageTagType(uint32_t tagId)
return mMsgSrv->removeMessageTagType(tagId); return mMsgSrv->removeMessageTagType(tagId);
} }
bool p3Msgs::getMessageTag(std::string msgId, MsgTagInfo& info) bool p3Msgs::getMessageTag(const std::string &msgId, MsgTagInfo& info)
{ {
return mMsgSrv->getMessageTag(msgId, info); return mMsgSrv->getMessageTag(msgId, info);
} }
bool p3Msgs::setMessageTag(std::string msgId, uint32_t tagId, bool set) bool p3Msgs::setMessageTag(const std::string &msgId, uint32_t tagId, bool set)
{ {
return mMsgSrv->setMessageTag(msgId, tagId, set); return mMsgSrv->setMessageTag(msgId, tagId, set);
} }

View file

@ -54,22 +54,25 @@ class p3Msgs: public RsMsgs
* @param msgList ref to list summarising client's msgs * @param msgList ref to list summarising client's msgs
*/ */
virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList); virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList);
virtual bool getMessage(std::string mId, MessageInfo &msg); virtual bool getMessage(const std::string &mId, MessageInfo &msg);
virtual void getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox, unsigned int *pnTrashbox); 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(MessageInfo &info);
virtual bool MessageToDraft(MessageInfo &info); virtual bool MessageToDraft(MessageInfo &info, const std::string &msgParentId);
virtual bool MessageToTrash(std::string mid, bool bTrash); virtual bool MessageToTrash(const std::string &mid, bool bTrash);
virtual bool MessageDelete(std::string mid); virtual bool MessageDelete(const std::string &mid);
virtual bool MessageRead(std::string mid, bool bUnreadByUser); virtual bool MessageRead(const std::string &mid, bool bUnreadByUser);
virtual bool MessageReplied(const std::string &mid, bool replied);
virtual bool MessageForwarded(const std::string &mid, bool forwarded);
virtual bool getMsgParentId(const std::string &msgId, std::string &msgParentId);
virtual bool getMessageTagTypes(MsgTagType& tags); virtual bool getMessageTagTypes(MsgTagType& tags);
virtual bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color); virtual bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color);
virtual bool removeMessageTagType(uint32_t tagId); virtual bool removeMessageTagType(uint32_t tagId);
virtual bool getMessageTag(std::string msgId, MsgTagInfo& info); virtual bool getMessageTag(const std::string &msgId, MsgTagInfo& info);
/* set == false && tagId == 0 --> remove all */ /* set == false && tagId == 0 --> remove all */
virtual bool setMessageTag(std::string msgId, uint32_t tagId, bool set); virtual bool setMessageTag(const std::string &msgId, uint32_t tagId, bool set);
virtual bool resetMessageStandardTagTypes(MsgTagType& tags); virtual bool resetMessageStandardTagTypes(MsgTagType& tags);

View file

@ -1102,12 +1102,146 @@ RsMsgSrcId* RsMsgSerialiser::deserialiseMsgSrcIdItem(void* data, uint32_t* pktsi
} }
/************************* end of definition of msgSrcId serialisation functions ************************/ /************************* end of definition of msgSrcId serialisation functions ************************/
/************************************** Message ParentId **********************/
RsMsgParentId::~RsMsgParentId()
{
return;
}
std::ostream& RsMsgParentId::print(std::ostream& out, uint16_t indent)
{
printRsItemBase(out, "RsMsgParentIdItem", indent);
uint16_t int_Indent = indent + 2;
printIndent(out, int_Indent);
out << "msgId : " << msgId << std::endl;
printIndent(out, int_Indent);
out << "msgParentId: " << msgParentId << std::endl;
printRsItemEnd(out, "RsMsgParentId", indent);
return out;
}
void RsMsgParentId::clear()
{
msgId = 0;
msgParentId = 0;
return;
}
uint32_t RsMsgSerialiser::sizeMsgParentIdItem(RsMsgParentId* item)
{
uint32_t s = 8; /* header */
s += 4; // srcId
s += 4; // msgParentId
return s;
}
bool RsMsgSerialiser::serialiseMsgParentIdItem(RsMsgParentId *item, void *data, uint32_t* pktsize)
{
uint32_t tlvsize = sizeMsgParentIdItem(item);
uint32_t offset = 0;
if (*pktsize < tlvsize)
return false; /* not enough space */
*pktsize = tlvsize;
bool ok = true;
ok &= setRsItemHeader(data, tlvsize, item->PacketId(), tlvsize);
#ifdef RSSERIAL_DEBUG
std::cerr << "RsMsgSerialiser::serialiseMsgParentIdItem() Header: " << ok << std::endl;
std::cerr << "RsMsgSerialiser::serialiseMsgParentIdItem() Size: " << tlvsize << std::endl;
#endif
/* skip the header */
offset += 8;
ok &= setRawUInt32(data, tlvsize, &offset, item->msgId);
ok &= setRawUInt32(data, tlvsize, &offset, item->msgParentId);
if (offset != tlvsize)
{
ok = false;
#ifdef RSSERIAL_DEBUG
std::cerr << "RsMsgSerialiser::serialiseMsgParentIdItem() Size Error! " << std::endl;
#endif
}
return ok;
}
RsMsgParentId* RsMsgSerialiser::deserialiseMsgParentIdItem(void* data, uint32_t* pktsize)
{
/* get the type and size */
uint32_t rstype = getRsItemId(data);
uint32_t rssize = getRsItemSize(data);
uint32_t offset = 0;
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) ||
(RS_SERVICE_TYPE_MSG != getRsItemService(rstype)) ||
(RS_PKT_SUBTYPE_MSG_PARENT_TAG != getRsItemSubType(rstype)))
{
return NULL; /* wrong type */
}
if (*pktsize < rssize) /* check size */
return NULL; /* not enough data */
/* set the packet length */
*pktsize = rssize;
bool ok = true;
/* ready to load */
RsMsgParentId *item = new RsMsgParentId();
item->clear();
/* skip the header */
offset += 8;
/* get mandatory parts first */
ok &= getRawUInt32(data, rssize, &offset, &(item->msgId));
ok &= getRawUInt32(data, rssize, &offset, &(item->msgParentId));
if (offset != rssize)
{
/* error */
delete item;
return NULL;
}
if (!ok)
{
delete item;
return NULL;
}
return item;
}
/************************* end of definition of msgParentId serialisation functions ************************/
uint32_t RsMsgSerialiser::size(RsItem *i) uint32_t RsMsgSerialiser::size(RsItem *i)
{ {
RsMsgItem *mi; RsMsgItem *mi;
RsMsgTagType *mtt; RsMsgTagType *mtt;
RsMsgTags *mts; RsMsgTags *mts;
RsMsgSrcId *msi; RsMsgSrcId *msi;
RsMsgParentId *msp;
/* in order of frequency */ /* in order of frequency */
if (NULL != (mi = dynamic_cast<RsMsgItem *>(i))) if (NULL != (mi = dynamic_cast<RsMsgItem *>(i)))
@ -1118,6 +1252,10 @@ uint32_t RsMsgSerialiser::size(RsItem *i)
{ {
return sizeMsgSrcIdItem(msi); return sizeMsgSrcIdItem(msi);
} }
else if (NULL != (msp = dynamic_cast<RsMsgParentId *>(i)))
{
return sizeMsgParentIdItem(msp);
}
else if (NULL != (mtt = dynamic_cast<RsMsgTagType *>(i))) else if (NULL != (mtt = dynamic_cast<RsMsgTagType *>(i)))
{ {
return sizeTagItem(mtt); return sizeTagItem(mtt);
@ -1138,6 +1276,7 @@ bool RsMsgSerialiser::serialise(RsItem *i, void *data, uint32_t *pktsize)
RsMsgItem *mi; RsMsgItem *mi;
RsMsgSrcId* msi; RsMsgSrcId* msi;
RsMsgParentId* msp;
RsMsgTagType *mtt; RsMsgTagType *mtt;
RsMsgTags *mts; RsMsgTags *mts;
@ -1150,6 +1289,10 @@ bool RsMsgSerialiser::serialise(RsItem *i, void *data, uint32_t *pktsize)
{ {
return serialiseMsgSrcIdItem(msi, data, pktsize); return serialiseMsgSrcIdItem(msi, data, pktsize);
} }
else if (NULL != (msp = dynamic_cast<RsMsgParentId *>(i)))
{
return serialiseMsgParentIdItem(msp, data, pktsize);
}
else if (NULL != (mtt = dynamic_cast<RsMsgTagType *>(i))) else if (NULL != (mtt = dynamic_cast<RsMsgTagType *>(i)))
{ {
return serialiseTagItem(mtt, data, pktsize); return serialiseTagItem(mtt, data, pktsize);
@ -1185,6 +1328,9 @@ RsItem* RsMsgSerialiser::deserialise(void *data, uint32_t *pktsize)
case RS_PKT_SUBTYPE_MSG_SRC_TAG: case RS_PKT_SUBTYPE_MSG_SRC_TAG:
return deserialiseMsgSrcIdItem(data, pktsize); return deserialiseMsgSrcIdItem(data, pktsize);
break; break;
case RS_PKT_SUBTYPE_MSG_PARENT_TAG:
return deserialiseMsgParentIdItem(data, pktsize);
break;
case RS_PKT_SUBTYPE_MSG_TAG_TYPE: case RS_PKT_SUBTYPE_MSG_TAG_TYPE:
return deserialiseTagItem(data, pktsize); return deserialiseTagItem(data, pktsize);
break; break;

View file

@ -54,6 +54,7 @@ const uint8_t RS_PKT_SUBTYPE_PRIVATECHATMSG_CONFIG = 0x05 ; // default is 0x01
const uint8_t RS_PKT_SUBTYPE_MSG_TAG_TYPE = 0x03; const uint8_t RS_PKT_SUBTYPE_MSG_TAG_TYPE = 0x03;
const uint8_t RS_PKT_SUBTYPE_MSG_TAGS = 0x04; const uint8_t RS_PKT_SUBTYPE_MSG_TAGS = 0x04;
const uint8_t RS_PKT_SUBTYPE_MSG_SRC_TAG = 0x05; const uint8_t RS_PKT_SUBTYPE_MSG_SRC_TAG = 0x05;
const uint8_t RS_PKT_SUBTYPE_MSG_PARENT_TAG = 0x06;
class RsChatItem: public RsItem class RsChatItem: public RsItem
@ -184,6 +185,8 @@ const uint32_t RS_MSG_FLAGS_DRAFT = 0x0004;
const uint32_t RS_MSG_FLAGS_NEW = 0x0010; const uint32_t RS_MSG_FLAGS_NEW = 0x0010;
const uint32_t RS_MSG_FLAGS_TRASH = 0x0020; const uint32_t RS_MSG_FLAGS_TRASH = 0x0020;
const uint32_t RS_MSG_FLAGS_UNREAD_BY_USER = 0x0040; 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;
class RsMsgItem: public RsItem class RsMsgItem: public RsItem
{ {
@ -275,6 +278,26 @@ public:
}; };
class RsMsgParentId : public RsItem
{
public:
RsMsgParentId()
: RsItem(RS_PKT_VERSION_SERVICE, RS_SERVICE_TYPE_MSG,
RS_PKT_SUBTYPE_MSG_PARENT_TAG)
{ return;}
std::ostream &print(std::ostream &out, uint16_t indent = 0);
virtual ~RsMsgParentId();
virtual void clear();
uint32_t msgId;
uint32_t msgParentId;
};
class RsMsgSerialiser: public RsSerialType class RsMsgSerialiser: public RsSerialType
{ {
public: public:
@ -311,6 +334,9 @@ virtual uint32_t sizeMsgSrcIdItem(RsMsgSrcId *);
virtual bool serialiseMsgSrcIdItem (RsMsgSrcId *item, void *data, uint32_t *size); virtual bool serialiseMsgSrcIdItem (RsMsgSrcId *item, void *data, uint32_t *size);
virtual RsMsgSrcId *deserialiseMsgSrcIdItem(void *data, uint32_t *size); virtual RsMsgSrcId *deserialiseMsgSrcIdItem(void *data, uint32_t *size);
virtual uint32_t sizeMsgParentIdItem(RsMsgParentId *);
virtual bool serialiseMsgParentIdItem (RsMsgParentId *item, void *data, uint32_t *size);
virtual RsMsgParentId *deserialiseMsgParentIdItem(void *data, uint32_t *size);
bool m_bConfiguration; // is set to true for saving configuration (enables serialising msgId) bool m_bConfiguration; // is set to true for saving configuration (enables serialising msgId)

View file

@ -135,7 +135,6 @@ int p3MsgService::incomingMsgs()
changed = true ; changed = true ;
++i; ++i;
mi -> recvTime = time(NULL); mi -> recvTime = time(NULL);
mi -> msgFlags = RS_MSG_FLAGS_NEW;
mi -> msgId = getNewUniqueMsgId(); mi -> msgId = getNewUniqueMsgId();
std::string mesg; std::string mesg;
@ -149,6 +148,8 @@ int p3MsgService::incomingMsgs()
} }
else else
{ {
mi -> msgFlags = RS_MSG_FLAGS_NEW;
/* from a peer */ /* from a peer */
MsgInfoSummary mis; MsgInfoSummary mis;
initRsMIS(mi, mis); initRsMIS(mi, mis);
@ -285,6 +286,7 @@ std::list<RsItem*> p3MsgService::saveList(bool& cleanup)
std::map<uint32_t, RsMsgTagType* >::iterator mit2; std::map<uint32_t, RsMsgTagType* >::iterator mit2;
std::map<uint32_t, RsMsgTags* >::iterator mit3; std::map<uint32_t, RsMsgTags* >::iterator mit3;
std::list<RsMsgSrcId* >::iterator lit; std::list<RsMsgSrcId* >::iterator lit;
std::map<uint32_t, RsMsgParentId* >::iterator mit4;
MsgTagType stdTags; MsgTagType stdTags;
@ -308,6 +310,9 @@ std::list<RsItem*> p3MsgService::saveList(bool& cleanup)
for(mit3 = mMsgTags.begin(); mit3 != mMsgTags.end(); mit3++) for(mit3 = mMsgTags.begin(); mit3 != mMsgTags.end(); mit3++)
itemList.push_back(mit3->second); itemList.push_back(mit3->second);
for(mit4 = mParentId.begin(); mit4 != mParentId.end(); mit4++)
itemList.push_back(mit4->second);
return itemList; return itemList;
} }
@ -371,6 +376,7 @@ bool p3MsgService::loadList(std::list<RsItem*> load)
RsMsgTagType* mtt; RsMsgTagType* mtt;
RsMsgTags* mti; RsMsgTags* mti;
RsMsgSrcId* msi; RsMsgSrcId* msi;
RsMsgParentId* msp;
std::list<RsMsgItem*> items; std::list<RsMsgItem*> items;
std::list<RsItem*>::iterator it; std::list<RsItem*>::iterator it;
@ -415,6 +421,10 @@ bool p3MsgService::loadList(std::list<RsItem*> load)
srcIdMsgMap.insert(std::pair<uint32_t, std::string>(msi->msgId, msi->srcId)); srcIdMsgMap.insert(std::pair<uint32_t, std::string>(msi->msgId, msi->srcId));
mSrcIdList.push_back(msi); // does not need to be kept mSrcIdList.push_back(msi); // does not need to be kept
} }
else if(NULL != (msp = dynamic_cast<RsMsgParentId *>(*it)))
{
mParentId.insert(std::pair<uint32_t, RsMsgParentId*>(msp->msgId, msp));
}
} }
// sort items into lists // sort items into lists
@ -453,6 +463,20 @@ bool p3MsgService::loadList(std::list<RsItem*> load)
} }
} }
/* remove missing msgId in mParentId */
std::map<uint32_t, RsMsgParentId *>::iterator mit = mParentId.begin();
while (mit != mParentId.end()) {
if (imsg.find(mit->first) == imsg.end()) {
if (msgOutgoing.find(mit->first) == msgOutgoing.end()) {
/* not found */
mParentId.erase(mit++);
continue;
}
}
mit++;
}
return true; return true;
} }
@ -523,7 +547,7 @@ bool p3MsgService::getMessageSummaries(std::list<MsgInfoSummary> &msgList)
} }
bool p3MsgService::getMessage(std::string &mId, MessageInfo &msg) bool p3MsgService::getMessage(const std::string &mId, MessageInfo &msg)
{ {
std::map<uint32_t, RsMsgItem *>::iterator mit; std::map<uint32_t, RsMsgItem *>::iterator mit;
uint32_t msgId = atoi(mId.c_str()); uint32_t msgId = atoi(mId.c_str());
@ -590,7 +614,7 @@ void p3MsgService::getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxN
} }
/* remove based on the unique mid (stored in sid) */ /* remove based on the unique mid (stored in sid) */
bool p3MsgService::removeMsgId(std::string &mid) bool p3MsgService::removeMsgId(const std::string &mid)
{ {
std::map<uint32_t, RsMsgItem *>::iterator mit; std::map<uint32_t, RsMsgItem *>::iterator mit;
uint32_t msgId = atoi(mid.c_str()); uint32_t msgId = atoi(mid.c_str());
@ -627,6 +651,7 @@ bool p3MsgService::removeMsgId(std::string &mid)
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/ IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
setMessageTag(mid, 0, false); setMessageTag(mid, 0, false);
setMsgParentId(msgId, 0);
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_MOD); rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_MOD);
} }
@ -634,7 +659,7 @@ bool p3MsgService::removeMsgId(std::string &mid)
return changed; return changed;
} }
bool p3MsgService::markMsgIdRead(std::string &mid, bool bUnreadByUser) bool p3MsgService::markMsgIdRead(const std::string &mid, bool bUnreadByUser)
{ {
std::map<uint32_t, RsMsgItem *>::iterator mit; std::map<uint32_t, RsMsgItem *>::iterator mit;
uint32_t msgId = atoi(mid.c_str()); uint32_t msgId = atoi(mid.c_str());
@ -677,6 +702,104 @@ bool p3MsgService::markMsgIdRead(std::string &mid, bool bUnreadByUser)
return true; return true;
} }
bool p3MsgService::setMsgFlag(const std::string &mid, uint32_t flag, uint32_t mask)
{
std::map<uint32_t, RsMsgItem *>::iterator mit;
uint32_t msgId = atoi(mid.c_str());
bool changed = false;
{
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
mit = imsg.find(msgId);
if (mit == imsg.end())
{
mit = msgOutgoing.find(msgId);
if (mit == msgOutgoing.end())
{
return false;
}
}
uint32_t oldFlag = mit->second->msgFlags;
mit->second->msgFlags &= ~mask;
mit->second->msgFlags |= flag;
if (mit->second->msgFlags != oldFlag) {
changed = true;
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
}
} /* UNLOCKED */
if (changed) {
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_MOD);
}
return true;
}
bool p3MsgService::getMsgParentId(const std::string &msgId, std::string &msgParentId)
{
msgParentId.clear();
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
std::map<uint32_t, RsMsgParentId *>::iterator mit = mParentId.find(atoi(msgId.c_str()));
if (mit == mParentId.end()) {
return false;
}
std::ostringstream out;
out << mit->second->msgParentId;
msgParentId = out.str();
return true;
}
bool p3MsgService::setMsgParentId(uint32_t msgId, uint32_t msgParentId)
{
std::map<uint32_t, RsMsgParentId *>::iterator mit;
bool changed = false;
{
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
mit = mParentId.find(msgId);
if (mit == mParentId.end())
{
if (msgParentId) {
RsMsgParentId* msp = new RsMsgParentId();
msp->PeerId (mConnMgr->getOwnId());
msp->msgId = msgId;
msp->msgParentId = msgParentId;
mParentId.insert(std::pair<uint32_t, RsMsgParentId*>(msgId, msp));
changed = true;
}
} else {
if (msgParentId) {
if (mit->second->msgParentId != msgParentId) {
mit->second->msgParentId = msgParentId;
changed = true;
}
} else {
delete mit->second;
mParentId.erase(mit);
changed = true;
}
}
} /* UNLOCKED */
if (changed) {
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
}
return true;
}
/****************************************/ /****************************************/
/****************************************/ /****************************************/
/* Message Items */ /* Message Items */
@ -745,7 +868,7 @@ bool p3MsgService::MessageSend(MessageInfo &info)
return true; return true;
} }
bool p3MsgService::MessageToDraft(MessageInfo &info) bool p3MsgService::MessageToDraft(MessageInfo &info, const std::string &msgParentId)
{ {
RsMsgItem *msg = initMIRsMsg(info, mConnMgr->getOwnId()); RsMsgItem *msg = initMIRsMsg(info, mConnMgr->getOwnId());
if (msg) if (msg)
@ -786,6 +909,8 @@ bool p3MsgService::MessageToDraft(MessageInfo &info)
info.msgId = out.str(); info.msgId = out.str();
} }
setMsgParentId(msg->msgId, atoi(msgParentId.c_str()));
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/ IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_MOD); rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_MOD);
@ -919,7 +1044,7 @@ bool p3MsgService::removeMessageTagType(uint32_t tagId)
return true; return true;
} }
bool p3MsgService::getMessageTag(std::string &msgId, MsgTagInfo& info) bool p3MsgService::getMessageTag(const std::string &msgId, MsgTagInfo& info)
{ {
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/ RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
@ -945,7 +1070,7 @@ bool p3MsgService::getMessageTag(std::string &msgId, MsgTagInfo& info)
} }
/* set == false && tagId == 0 --> remove all */ /* set == false && tagId == 0 --> remove all */
bool p3MsgService::setMessageTag(std::string &msgId, uint32_t tagId, bool set) bool p3MsgService::setMessageTag(const std::string &msgId, uint32_t tagId, bool set)
{ {
uint32_t mid = atoi(msgId.c_str()); uint32_t mid = atoi(msgId.c_str());
if (mid == 0) { if (mid == 0) {
@ -1047,7 +1172,7 @@ bool p3MsgService::resetMessageStandardTagTypes(MsgTagType& tags)
} }
/* move message to trash based on the unique mid */ /* move message to trash based on the unique mid */
bool p3MsgService::MessageToTrash(std::string mid, bool bTrash) bool p3MsgService::MessageToTrash(const std::string &mid, bool bTrash)
{ {
std::map<uint32_t, RsMsgItem *>::iterator mit; std::map<uint32_t, RsMsgItem *>::iterator mit;
uint32_t msgId = atoi(mid.c_str()); uint32_t msgId = atoi(mid.c_str());
@ -1141,6 +1266,14 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi)
{ {
mi.msgflags |= RS_MSG_UNREAD_BY_USER; mi.msgflags |= RS_MSG_UNREAD_BY_USER;
} }
if (msg->msgFlags & RS_MSG_FLAGS_REPLIED)
{
mi.msgflags |= RS_MSG_REPLIED;
}
if (msg->msgFlags & RS_MSG_FLAGS_FORWARDED)
{
mi.msgflags |= RS_MSG_FORWARDED;
}
mi.ts = msg->sendTime; mi.ts = msg->sendTime;
mi.srcId = msg->PeerId(); mi.srcId = msg->PeerId();
@ -1228,6 +1361,14 @@ void p3MsgService::initRsMIS(RsMsgItem *msg, MsgInfoSummary &mis)
{ {
mis.msgflags |= RS_MSG_UNREAD_BY_USER; mis.msgflags |= RS_MSG_UNREAD_BY_USER;
} }
if (msg->msgFlags & RS_MSG_FLAGS_REPLIED)
{
mis.msgflags |= RS_MSG_REPLIED;
}
if (msg->msgFlags & RS_MSG_FLAGS_FORWARDED)
{
mis.msgflags |= RS_MSG_FORWARDED;
}
mis.srcId = msg->PeerId(); mis.srcId = msg->PeerId();
{ {

View file

@ -56,23 +56,27 @@ bool MsgNotifications(); /* popup - messages */
bool getMessageNotifications(std::list<MsgInfoSummary> &noteList); bool getMessageNotifications(std::list<MsgInfoSummary> &noteList);
bool getMessageSummaries(std::list<MsgInfoSummary> &msgList); bool getMessageSummaries(std::list<MsgInfoSummary> &msgList);
bool getMessage(std::string &mid, MessageInfo &msg); bool getMessage(const std::string &mid, MessageInfo &msg);
void getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox, unsigned int *pnTrashbox); void getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox, unsigned int *pnTrashbox);
bool removeMsgId(std::string &mid); bool removeMsgId(const std::string &mid);
bool markMsgIdRead(std::string &mid, bool bUnreadByUser); bool markMsgIdRead(const std::string &mid, bool bUnreadByUser);
bool setMsgFlag(const std::string &mid, uint32_t flag, uint32_t mask);
bool getMsgParentId(const std::string &msgId, std::string &msgParentId);
// msgParentId == 0 --> remove
bool setMsgParentId(uint32_t msgId, uint32_t msgParentId);
bool MessageSend(MessageInfo &info); bool MessageSend(MessageInfo &info);
bool MessageToDraft(MessageInfo &info); bool MessageToDraft(MessageInfo &info, const std::string &msgParentId);
bool MessageToTrash(std::string mid, bool bTrash); bool MessageToTrash(const std::string &mid, bool bTrash);
bool getMessageTagTypes(MsgTagType& tags); bool getMessageTagTypes(MsgTagType& tags);
bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color); bool setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color);
bool removeMessageTagType(uint32_t tagId); bool removeMessageTagType(uint32_t tagId);
bool getMessageTag(std::string &msgId, MsgTagInfo& info); bool getMessageTag(const std::string &msgId, MsgTagInfo& info);
/* set == false && tagId == 0 --> remove all */ /* set == false && tagId == 0 --> remove all */
bool setMessageTag(std::string &msgId, uint32_t tagId, bool set); bool setMessageTag(const std::string &msgId, uint32_t tagId, bool set);
bool resetMessageStandardTagTypes(MsgTagType& tags); bool resetMessageStandardTagTypes(MsgTagType& tags);
@ -134,6 +138,9 @@ void initStandardTagTypes();
// used delete msgSrcIds after config save // used delete msgSrcIds after config save
std::list<RsMsgSrcId*> mSrcIdList; std::list<RsMsgSrcId*> mSrcIdList;
// save the parent of the messages in draft for replied and forwarded
std::map<uint32_t, RsMsgParentId*> mParentId;
std::string config_dir; std::string config_dir;
}; };

View file

@ -124,6 +124,13 @@ RsSerialType* init_item(RsMsgSrcId& ms)
return new RsMsgSerialiser(); return new RsMsgSerialiser();
} }
RsSerialType* init_item(RsMsgParentId& ms)
{
ms.msgId = rand()%354;
ms.msgParentId = rand()%476;
return new RsMsgSerialiser();
}
bool operator ==(const RsChatMsgItem& cmiLeft,const RsChatMsgItem& cmiRight) bool operator ==(const RsChatMsgItem& cmiLeft,const RsChatMsgItem& cmiRight)
{ {
@ -223,6 +230,14 @@ bool operator ==(const RsMsgSrcId& msLeft, const RsMsgSrcId& msRight)
return true; return true;
} }
bool operator ==(const RsMsgParentId& msLeft, const RsMsgParentId& msRight)
{
if(msLeft.msgId != msRight.msgId) return false;
if(msLeft.msgParentId != msRight.msgParentId) return false;
return true;
}
int main() int main()
{ {
test_RsItem<RsChatMsgItem >(); REPORT("Serialise/Deserialise RsChatMsgItem"); test_RsItem<RsChatMsgItem >(); REPORT("Serialise/Deserialise RsChatMsgItem");
@ -233,6 +248,7 @@ int main()
test_RsItem<RsMsgTagType>(); REPORT("Serialise/Deserialise RsMsgTagType"); test_RsItem<RsMsgTagType>(); REPORT("Serialise/Deserialise RsMsgTagType");
test_RsItem<RsMsgTags>(); REPORT("Serialise/Deserialise RsMsgTags"); test_RsItem<RsMsgTags>(); REPORT("Serialise/Deserialise RsMsgTags");
test_RsItem<RsMsgSrcId>(); REPORT("Serialise/Deserialise RsMsgSrcId"); test_RsItem<RsMsgSrcId>(); REPORT("Serialise/Deserialise RsMsgSrcId");
test_RsItem<RsMsgParentId>(); REPORT("Serialise/Deserialise RsMsgParentId");
std::cerr << std::endl; std::cerr << std::endl;

View file

@ -1704,16 +1704,13 @@ void ForumsDialog::replytomessage()
if (rsPeers->getPeerName(msgInfo.srcId) !="") if (rsPeers->getPeerName(msgInfo.srcId) !="")
{ {
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
nMsgDialog->newMsg(); nMsgDialog->insertTitleText(QString::fromStdWString(msgInfo.title), MessageComposer::REPLY);
nMsgDialog->insertTitleText( (QString("Re:") + " " + QString::fromStdWString(msgInfo.title)).toStdString()) ;
nMsgDialog->setWindowTitle(tr("Re:") + " " + QString::fromStdWString(msgInfo.title) ) ;
QTextDocument doc ; QTextDocument doc ;
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ; doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
std::string cited_text(doc.toPlainText().toStdString()) ;
nMsgDialog->insertPastedText(cited_text) ; nMsgDialog->insertPastedText(doc.toPlainText());
nMsgDialog->addRecipient(MessageComposer::TO, msgInfo.srcId, false); nMsgDialog->addRecipient(MessageComposer::TO, msgInfo.srcId, false);
nMsgDialog->show(); nMsgDialog->show();
nMsgDialog->activateWindow(); nMsgDialog->activateWindow();

View file

@ -70,6 +70,7 @@
#define ROLE_MSGID Qt::UserRole + 1 #define ROLE_MSGID Qt::UserRole + 1
#define ROLE_SRCID Qt::UserRole + 2 #define ROLE_SRCID Qt::UserRole + 2
#define ROLE_UNREAD Qt::UserRole + 3 #define ROLE_UNREAD Qt::UserRole + 3
#define ROLE_MSGFLAGS Qt::UserRole + 4
#define ROW_INBOX 0 #define ROW_INBOX 0
#define ROW_OUTBOX 1 #define ROW_OUTBOX 1
@ -737,11 +738,13 @@ void MessagesDialog::folderlistWidgetCostumPopupMenu(QPoint point)
void MessagesDialog::newmessage() void MessagesDialog::newmessage()
{ {
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
/* fill it in */ /* fill it in */
//std::cerr << "MessagesDialog::newmessage()" << std::endl; //std::cerr << "MessagesDialog::newmessage()" << std::endl;
nMsgDialog->newMsg();
nMsgDialog->show(); nMsgDialog->show();
nMsgDialog->activateWindow(); nMsgDialog->activateWindow();
@ -757,16 +760,11 @@ void MessagesDialog::editmessage()
if(!getCurrentMsg(cid, mid)) if(!getCurrentMsg(cid, mid))
return ; return ;
MessageInfo msgInfo; MessageComposer *pMsgDialog = MessageComposer::newMsg(mid);
if (!rsMsgs->getMessage(mid, msgInfo)) { if (pMsgDialog == NULL) {
std::cerr << "MessagesDialog::editmessage() Couldn't find Msg" << std::endl;
return; return;
} }
MessageComposer *pMsgDialog = new MessageComposer();
/* fill it in */
pMsgDialog->newMsg(msgInfo.msgId);
pMsgDialog->show(); pMsgDialog->show();
pMsgDialog->activateWindow(); pMsgDialog->activateWindow();
@ -786,35 +784,11 @@ void MessagesDialog::replytomessage()
mCurrCertId = cid; mCurrCertId = cid;
mCurrMsgId = mid; mCurrMsgId = mid;
MessageInfo msgInfo; MessageComposer *nMsgDialog = MessageComposer::replyMsg(mid, false);
if (!rsMsgs -> getMessage(mid, msgInfo)) if (nMsgDialog == NULL) {
return ; return;
MessageComposer *nMsgDialog = new MessageComposer();
/* fill it in */
//std::cerr << "MessagesDialog::newmessage()" << std::endl;
nMsgDialog->newMsg();
QString text = QString::fromStdWString(msgInfo.title);
if (text.startsWith("Re:", Qt::CaseInsensitive))
{
nMsgDialog->insertTitleText( QString::fromStdWString(msgInfo.title).toStdString()) ;
}
else
{
nMsgDialog->insertTitleText( (QString("Re:") + " " + QString::fromStdWString(msgInfo.title)).toStdString()) ;
} }
nMsgDialog->setWindowTitle( tr ("Compose: ") + tr("Re:") + " " + QString::fromStdWString(msgInfo.title) ) ;
QTextDocument doc ;
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
std::string cited_text(doc.toPlainText().toStdString()) ;
nMsgDialog->insertPastedText(cited_text) ;
nMsgDialog->addRecipient(MessageComposer::TO, msgInfo.srcId, false);
nMsgDialog->show(); nMsgDialog->show();
nMsgDialog->activateWindow(); nMsgDialog->activateWindow();
@ -834,40 +808,9 @@ void MessagesDialog::replyallmessage()
mCurrCertId = cid; mCurrCertId = cid;
mCurrMsgId = mid; mCurrMsgId = mid;
MessageInfo msgInfo; MessageComposer *nMsgDialog = MessageComposer::replyMsg(mid, true);
if (!rsMsgs -> getMessage(mid, msgInfo)) if (nMsgDialog == NULL) {
return ; return;
MessageComposer *nMsgDialog = new MessageComposer();
/* fill it in */
//std::cerr << "MessagesDialog::newmessage()" << std::endl;
nMsgDialog->newMsg();
QString text = QString::fromStdWString(msgInfo.title);
if (text.startsWith("Re:", Qt::CaseInsensitive))
{
nMsgDialog->insertTitleText( QString::fromStdWString(msgInfo.title).toStdString()) ;
}
else
{
nMsgDialog->insertTitleText( (QString("Re:") + " " + QString::fromStdWString(msgInfo.title)).toStdString()) ;
}
nMsgDialog->setWindowTitle( tr ("Compose: ") + tr("Re:") + " " + QString::fromStdWString(msgInfo.title) ) ;
QTextDocument doc ;
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
std::string cited_text(doc.toPlainText().toStdString()) ;
nMsgDialog->insertPastedText(cited_text) ;
nMsgDialog->addRecipient(MessageComposer::TO, msgInfo.srcId, false);
std::list<std::string> tl ( msgInfo.msgto );
for ( std::list<std::string>::iterator tli = tl.begin(); tli!= tl.end(); tli++ )
{
nMsgDialog->addRecipient(MessageComposer::TO, *tli, false) ;
} }
nMsgDialog->show(); nMsgDialog->show();
@ -889,46 +832,11 @@ void MessagesDialog::forwardmessage()
mCurrCertId = cid; mCurrCertId = cid;
mCurrMsgId = mid; mCurrMsgId = mid;
MessageInfo msgInfo; MessageComposer *nMsgDialog = MessageComposer::forwardMsg(mid);
if (!rsMsgs -> getMessage(mid, msgInfo)) if (nMsgDialog == NULL) {
return ; return;
MessageComposer *nMsgDialog = new MessageComposer();
/* fill it in */
//std::cerr << "MessagesDialog::newmessage()" << std::endl;
nMsgDialog->newMsg();
QString text = QString::fromStdWString(msgInfo.title);
if (text.startsWith("Fwd:", Qt::CaseInsensitive))
{
nMsgDialog->insertTitleText( QString::fromStdWString(msgInfo.title).toStdString()) ;
}
else
{
nMsgDialog->insertTitleText( (QString("Fwd:") + " " + QString::fromStdWString(msgInfo.title)).toStdString()) ;
} }
nMsgDialog->setWindowTitle( tr ("Compose:") + " " + tr("Fwd:") + " " + QString::fromStdWString(msgInfo.title) ) ;
QTextDocument doc ;
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
std::string cited_text(doc.toPlainText().toStdString()) ;
nMsgDialog->insertForwardPastedText(cited_text) ;
std::list<FileInfo>& files_info = msgInfo.files;
/* enable all files for sending */
std::list<FileInfo>::iterator it;
for(it = files_info.begin(); it != files_info.end(); it++)
{
it->inRecommend = true;
}
nMsgDialog->insertFileList(files_info);
//nMsgDialog->addRecipient( msgInfo.srcId ) ;
nMsgDialog->show(); nMsgDialog->show();
nMsgDialog->activateWindow(); nMsgDialog->activateWindow();
@ -1087,31 +995,37 @@ void MessagesDialog::messagesTagsChanged()
insertMessages(); insertMessages();
} }
static void InitIconAndFont(QStandardItem *pItem [COLUMN_COUNT], int nFlag) static void InitIconAndFont(QStandardItem *pItem [COLUMN_COUNT])
{ {
QString sText = pItem [COLUMN_SUBJECT]->text(); QString sText = pItem [COLUMN_SUBJECT]->text();
QString mid = pItem [COLUMN_DATA]->data(ROLE_MSGID).toString(); QString mid = pItem [COLUMN_DATA]->data(ROLE_MSGID).toString();
int nFlag = pItem [COLUMN_DATA]->data(ROLE_MSGFLAGS).toInt();
// show the real "New" state // show the real "New" state
if (nFlag & RS_MSG_NEW) { if (nFlag & RS_MSG_NEW) {
if (sText.startsWith("Re:", Qt::CaseInsensitive)) { pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-state-new.png"));
} else {
if (nFlag & RS_MSG_UNREAD_BY_USER) {
if ((nFlag & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_REPLIED) {
pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-replied.png")); pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-replied.png"));
} else if (sText.startsWith("Fwd:", Qt::CaseInsensitive)) { } else if ((nFlag & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_FORWARDED) {
pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-forwarded.png")); pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-forwarded.png"));
} else if ((nFlag & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == (RS_MSG_REPLIED | RS_MSG_FORWARDED)) {
pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-replied-forw.png"));
} else { } else {
pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail.png")); pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail.png"));
} }
pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-state-new.png"));
} else { } else {
// Change Message icon when Subject is Re: or Fwd: if ((nFlag & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_REPLIED) {
if (sText.startsWith("Re:", Qt::CaseInsensitive)) {
pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-replied-read.png")); pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-replied-read.png"));
} else if (sText.startsWith("Fwd:", Qt::CaseInsensitive)) { } else if ((nFlag & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_FORWARDED) {
pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-forwarded-read.png")); pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-forwarded-read.png"));
} else if ((nFlag & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == (RS_MSG_REPLIED | RS_MSG_FORWARDED)) {
pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-replied-forw-read.png"));
} else { } else {
pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-read.png")); pItem[COLUMN_SUBJECT]->setIcon(QIcon(":/images/message-mail-read.png"));
} }
pItem[COLUMN_SUBJECT]->setIcon(QIcon()); }
} }
bool bNew = nFlag & (RS_MSG_NEW | RS_MSG_UNREAD_BY_USER); bool bNew = nFlag & (RS_MSG_NEW | RS_MSG_UNREAD_BY_USER);
@ -1405,9 +1319,10 @@ void MessagesDialog::insertMessages()
QString msgId = QString::fromStdString(it->msgId); QString msgId = QString::fromStdString(it->msgId);
item[COLUMN_DATA]->setData(QString::fromStdString(it->srcId), ROLE_SRCID); item[COLUMN_DATA]->setData(QString::fromStdString(it->srcId), ROLE_SRCID);
item[COLUMN_DATA]->setData(msgId, ROLE_MSGID); item[COLUMN_DATA]->setData(msgId, ROLE_MSGID);
item[COLUMN_DATA]->setData(it->msgflags, ROLE_MSGFLAGS);
// Init icon and font // Init icon and font
InitIconAndFont(item, it->msgflags); InitIconAndFont(item);
// Tags // Tags
MsgTagInfo tagInfo; MsgTagInfo tagInfo;
@ -1555,7 +1470,18 @@ void MessagesDialog::setMsgAsReadUnread(const QList<int> &Rows, bool bRead)
std::string mid = item[COLUMN_DATA]->data(ROLE_MSGID).toString().toStdString(); std::string mid = item[COLUMN_DATA]->data(ROLE_MSGID).toString().toStdString();
if (rsMsgs->MessageRead(mid, !bRead)) { if (rsMsgs->MessageRead(mid, !bRead)) {
InitIconAndFont(item, bRead ? 0 : RS_MSG_UNREAD_BY_USER); int nFlag = item[COLUMN_DATA]->data(ROLE_MSGFLAGS).toInt();
nFlag &= ~RS_MSG_NEW;
if (bRead) {
nFlag &= ~RS_MSG_UNREAD_BY_USER;
} else {
nFlag |= RS_MSG_UNREAD_BY_USER;
}
item[COLUMN_DATA]->setData(nFlag, ROLE_MSGFLAGS);
InitIconAndFont(item);
} }
} }

View file

@ -1433,9 +1433,9 @@ void PeersDialog::insertChat()
QString notifyMsg = name + ": " + editor.toPlainText(); QString notifyMsg = name + ": " + editor.toPlainText();
if(notifyMsg.length() > 30) if(notifyMsg.length() > 30)
emit notifyGroupChat(QString("New group chat"), notifyMsg.left(30) + QString("...")); emit notifyGroupChat(tr("New group chat"), notifyMsg.left(30) + QString("..."));
else else
emit notifyGroupChat(QString("New group chat"), notifyMsg); emit notifyGroupChat(tr("New group chat"), notifyMsg);
} }
historyKeeper.addMessage(incoming, it->rsid, name, sendTime, recvTime, msg); historyKeeper.addMessage(incoming, it->rsid, name, sendTime, recvTime, msg);

View file

@ -899,7 +899,7 @@ p, li { white-space: pre-wrap; }
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
<string>Live Chat</string> <string>Group Chat</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="0">

View file

@ -1199,12 +1199,14 @@ void SearchDialog::sendLinkTo( )
copysearchLink(); copysearchLink();
/* create a message */ /* create a message */
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
nMsgDialog->newMsg(); nMsgDialog->insertTitleText(tr("New RetroShare Link(s)"));
nMsgDialog->insertTitleText("New RetroShare Link(s)");
nMsgDialog->insertMsgText(RSLinkClipboard::toHtml().toStdString()) ; nMsgDialog->insertMsgText(RSLinkClipboard::toHtml()) ;
nMsgDialog->show(); nMsgDialog->show();
/* window will destroy itself! */ /* window will destroy itself! */

View file

@ -410,16 +410,18 @@ void SharedFilesDialog::sendremoteLinkTo()
copyLinkRemote (); copyLinkRemote ();
/* create a message */ /* create a message */
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
/* fill it in /* fill it in
* files are receommended already * files are receommended already
* just need to set peers * just need to set peers
*/ */
std::cerr << "SharedFilesDialog::sendremoteLinkTo()" << std::endl; std::cerr << "SharedFilesDialog::sendremoteLinkTo()" << std::endl;
nMsgDialog->newMsg(); nMsgDialog->insertTitleText(tr("RetroShare Link"));
nMsgDialog->insertTitleText("RetroShare Link"); nMsgDialog->insertMsgText(RSLinkClipboard::toHtml());
nMsgDialog->insertMsgText(RSLinkClipboard::toHtml().toStdString());
nMsgDialog->show(); nMsgDialog->show();
@ -431,40 +433,43 @@ void SharedFilesDialog::sendLinkTo()
copyLinkLocal (); copyLinkLocal ();
/* create a message */ /* create a message */
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
/* fill it in /* fill it in
* files are receommended already * files are receommended already
* just need to set peers * just need to set peers
*/ */
std::cerr << "SharedFilesDialog::sendLinkTo()" << std::endl; std::cerr << "SharedFilesDialog::sendLinkTo()" << std::endl;
nMsgDialog->newMsg(); nMsgDialog->insertTitleText(tr("RetroShare Link"));
nMsgDialog->insertTitleText("RetroShare Link");
nMsgDialog->insertMsgText(RSLinkClipboard::toHtml().toStdString()); nMsgDialog->insertMsgText(RSLinkClipboard::toHtml());
nMsgDialog->show(); nMsgDialog->show();
/* window will destroy itself! */ /* window will destroy itself! */
} }
void SharedFilesDialog::sendHtmlLinkTo( ) void SharedFilesDialog::sendHtmlLinkTo()
{ {
copyLinkLocal (); copyLinkLocal ();
/* create a message */ /* create a message */
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
/* fill it in /* fill it in
* files are receommended already * files are receommended already
* just need to set peers * just need to set peers
*/ */
std::cerr << "SharedFilesDialog::sendLinkTo()" << std::endl; std::cerr << "SharedFilesDialog::sendLinkTo()" << std::endl;
nMsgDialog->newMsg(); nMsgDialog->insertTitleText(tr("RetroShare Link"));
nMsgDialog->insertTitleText("RetroShare Link");
// nMsgDialog->insertHtmlText(QApplication::clipboard()->text().toStdString());// not compatible with multiple links // nMsgDialog->insertHtmlText(QApplication::clipboard()->text().toStdString());// not compatible with multiple links
nMsgDialog->insertMsgText(RSLinkClipboard::toHtml().toStdString()); nMsgDialog->insertMsgText(RSLinkClipboard::toHtml());
nMsgDialog->show(); nMsgDialog->show();
@ -588,7 +593,10 @@ void SharedFilesDialog::recommendFilesTo( std::string rsid )
return ; return ;
/* create a message */ /* create a message */
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
/* fill it in /* fill it in
* files are receommended already * files are receommended already
@ -596,9 +604,14 @@ void SharedFilesDialog::recommendFilesTo( std::string rsid )
*/ */
nMsgDialog->insertFileList(files_info) ; nMsgDialog->insertFileList(files_info) ;
nMsgDialog->newMsg(); nMsgDialog->insertTitleText(tr("Recommendation(s)"));
nMsgDialog->insertTitleText("Recommendation(s)");
nMsgDialog->insertMsgText(rsPeers->getPeerName(rsPeers->getOwnId())+" recommends " + ( (files_info.size()>1)?"a list of files":"a file")+" to you"); QString peerName = QString::fromStdString(rsPeers->getPeerName(rsPeers->getOwnId()));
if (files_info.size() > 1) {
nMsgDialog->insertMsgText(tr("%1 recommends a list of files to you").arg(peerName));
} else {
nMsgDialog->insertMsgText(tr("%1 recommends a file to you").arg(peerName));
}
nMsgDialog->addRecipient(MessageComposer::TO, rsid, false) ; nMsgDialog->addRecipient(MessageComposer::TO, rsid, false) ;
nMsgDialog->sendMessage(); nMsgDialog->sendMessage();
@ -618,12 +631,14 @@ void SharedFilesDialog::recommendFilesToMsg( std::string rsid )
/* create a message */ /* create a message */
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
nMsgDialog->insertFileList(files_info) ; nMsgDialog->insertFileList(files_info) ;
nMsgDialog->newMsg(); nMsgDialog->insertTitleText(tr("Recommendation(s)"));
nMsgDialog->insertTitleText("Recommendation(s)"); nMsgDialog->insertMsgText(tr("Recommendation(s)"));
nMsgDialog->insertMsgText("Recommendation(s)");
nMsgDialog->show(); nMsgDialog->show();
std::cout << "recommending to " << rsid << std::endl ; std::cout << "recommending to " << rsid << std::endl ;

View file

@ -196,8 +196,10 @@ void ChatMsgItem::sendMsg()
if (mParent) if (mParent)
{ {
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
nMsgDialog->newMsg(); if (nMsgDialog == NULL) {
return;
}
nMsgDialog->addRecipient(MessageComposer::TO, mPeerId, false); nMsgDialog->addRecipient(MessageComposer::TO, mPeerId, false);
nMsgDialog->show(); nMsgDialog->show();

View file

@ -254,26 +254,15 @@ void MsgItem::replyMsg()
{ {
//mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, mMsgId); //mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, mMsgId);
MessageInfo msgInfo; MessageComposer *nMsgDialog = MessageComposer::replyMsg(mMsgId, false);
if (!rsMsgs -> getMessage(mMsgId, msgInfo)) if (nMsgDialog == NULL) {
return ; return;
}
MessageComposer *nMsgDialog = new MessageComposer();
nMsgDialog->newMsg();
nMsgDialog->insertTitleText( (QString("Re: ") + QString::fromStdWString(msgInfo.title)).toStdString()) ;
nMsgDialog->setWindowTitle(tr("Re: ") + QString::fromStdWString(msgInfo.title) ) ;
QTextDocument doc ;
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
std::string cited_text(doc.toPlainText().toStdString()) ;
nMsgDialog->insertPastedText(cited_text) ;
nMsgDialog->addRecipient(MessageComposer::TO, msgInfo.srcId, false);
nMsgDialog->show(); nMsgDialog->show();
nMsgDialog->activateWindow(); nMsgDialog->activateWindow();
/* window will destroy itself! */ /* window will destroy itself! */
} }
} }

View file

@ -302,8 +302,10 @@ void PeerItem::sendMsg()
{ {
//mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, ""); //mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, "");
MessageComposer *nMsgDialog = new MessageComposer(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
nMsgDialog->newMsg(); if (nMsgDialog == NULL) {
return;
}
nMsgDialog->addRecipient(MessageComposer::TO, mPeerId, false); nMsgDialog->addRecipient(MessageComposer::TO, mPeerId, false);
nMsgDialog->show(); nMsgDialog->show();

View file

@ -282,6 +282,8 @@
<file>images/message-mail-forwarded-read.png</file> <file>images/message-mail-forwarded-read.png</file>
<file>images/message-mail-replied.png</file> <file>images/message-mail-replied.png</file>
<file>images/message-mail-forwarded.png</file> <file>images/message-mail-forwarded.png</file>
<file>images/message-mail-replied-forw.png</file>
<file>images/message-mail-replied-forw-read.png</file>
<file>images/message-state-read.png</file> <file>images/message-state-read.png</file>
<file>images/message-state-unread.png</file> <file>images/message-state-unread.png</file>
<file>images/message-state-header.png</file> <file>images/message-state-header.png</file>

View file

@ -102,6 +102,8 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WFlags flags)
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
m_msgType = NORMAL;
setupFileActions(); setupFileActions();
setupEditActions(); setupEditActions();
setupViewActions(); setupViewActions();
@ -275,6 +277,9 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WFlags flags)
// load settings // load settings
processSettings(true); processSettings(true);
/* worker fns */
insertSendList();
/* set focus to subject */ /* set focus to subject */
ui.titleEdit->setFocus(); ui.titleEdit->setFocus();
@ -322,9 +327,10 @@ void MessageComposer::processSettings(bool bLoad)
/* create a message */ /* create a message */
MessageComposer *pMsgDialog = new MessageComposer(); MessageComposer *pMsgDialog = MessageComposer::newMsg();
if (pMsgDialog == NULL) {
pMsgDialog->newMsg(); return;
}
if (group) { if (group) {
pMsgDialog->addRecipient(TO, id, true); pMsgDialog->addRecipient(TO, id, true);
@ -383,15 +389,13 @@ void MessageComposer::recommendFriend(std::list <std::string> &peerids)
} }
/* create a message */ /* create a message */
MessageComposer *pMsgDialog = new MessageComposer(); MessageComposer *pMsgDialog = MessageComposer::newMsg();
pMsgDialog->newMsg(); pMsgDialog->insertTitleText(tr("Friend Recommendation(s)"));
pMsgDialog->setWindowTitle(tr("Compose") + ": " + tr("Friend Recommendation")) ;
pMsgDialog->insertTitleText(tr("Friend Recommendation(s)").toStdString());
std::string sMsgText = tr("I recommend a good friend of me, you can trust him too when you trust me. <br> Copy friend link and paste to Friends list").toStdString(); QString sMsgText = tr("I recommend a good friend of me, you can trust him too when you trust me. <br> Copy friend link and paste to Friends list");
sMsgText += "<br><br>"; sMsgText += "<br><br>";
sMsgText += BuildRecommendHtml(peerids).toStdString(); sMsgText += BuildRecommendHtml(peerids);
pMsgDialog->insertMsgText(sMsgText); pMsgDialog->insertMsgText(sMsgText);
// pMsgDialog->insertFileList(files_info); // pMsgDialog->insertFileList(files_info);
@ -704,7 +708,7 @@ void MessageComposer::insertFileList(const std::list<FileInfo>& files_info)
/* make a widget per person */ /* make a widget per person */
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0); QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
item->setText(0, QString::fromStdString(it->fname)); /* (0) Filename */ item->setText(0, QString::fromUtf8(it->fname.c_str())); /* (0) Filename */
item->setText(1, misc::friendlyUnit(it->size)); /* (1) Size */ item->setText(1, misc::friendlyUnit(it->size)); /* (1) Size */
item->setText(2, QString::number(0)) ;//it->rank)); item->setText(2, QString::number(0)) ;//it->rank));
item->setText(3, QString::fromStdString(it->hash)); item->setText(3, QString::fromStdString(it->hash));
@ -820,38 +824,38 @@ static void calculateGroupsOfSslIds(std::list<RsGroupInfo> &existingGroupInfos,
} }
} }
void MessageComposer::newMsg(std::string msgId /*= ""*/) MessageComposer *MessageComposer::newMsg(const std::string &msgId /*= ""*/)
{ {
/* clear all */ MessageComposer *msgComposer = new MessageComposer();
ui.msgText->setText("");
/* worker fns */ msgComposer->addEmptyRecipient();
insertSendList();
ui.recipientWidget->setRowCount(0); if (msgId.empty() == false) {
addEmptyRecipient();
m_sMsgId = msgId;
m_sDraftMsgId.clear();
if (m_sMsgId.empty() == false) {
// fill existing message // fill existing message
MessageInfo msgInfo; MessageInfo msgInfo;
if (!rsMsgs->getMessage(m_sMsgId, msgInfo)) { if (!rsMsgs->getMessage(msgId, msgInfo)) {
std::cerr << "MessageComposer::newMsg() Couldn't find Msg" << std::endl; std::cerr << "MessageComposer::newMsg() Couldn't find Msg" << std::endl;
m_sMsgId.clear(); delete msgComposer;
return; return NULL;
} }
if (msgInfo.msgflags & RS_MSG_DRAFT) { if (msgInfo.msgflags & RS_MSG_DRAFT) {
m_sDraftMsgId = msgId; msgComposer->m_sDraftMsgId = msgId;
rsMsgs->getMsgParentId(msgId, msgComposer->m_msgParentId);
if (msgInfo.msgflags & RS_MSG_REPLIED) {
msgComposer->m_msgType = REPLY;
} else if (msgInfo.msgflags & RS_MSG_FORWARDED) {
msgComposer->m_msgType = FORWARD;
}
} }
insertTitleText( QString::fromStdWString(msgInfo.title).toStdString()); msgComposer->insertTitleText(QString::fromStdWString(msgInfo.title));
insertMsgText(QString::fromStdWString(msgInfo.msg).toStdString()); msgComposer->insertMsgText(QString::fromStdWString(msgInfo.msg));
insertFileList(msgInfo.files); msgComposer->insertFileList(msgInfo.files);
// get existing groups // get existing groups
std::list<RsGroupInfo> groupInfoList; std::list<RsGroupInfo> groupInfoList;
@ -863,48 +867,152 @@ void MessageComposer::newMsg(std::string msgId /*= ""*/)
calculateGroupsOfSslIds(groupInfoList, msgInfo.msgto, groupIds); calculateGroupsOfSslIds(groupInfoList, msgInfo.msgto, groupIds);
for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) { for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
addRecipient(MessageComposer::TO, *groupIt, true) ; msgComposer->addRecipient(MessageComposer::TO, *groupIt, true) ;
} }
for (it = msgInfo.msgto.begin(); it != msgInfo.msgto.end(); it++ ) { for (it = msgInfo.msgto.begin(); it != msgInfo.msgto.end(); it++ ) {
addRecipient(MessageComposer::TO, *it, false) ; msgComposer->addRecipient(MessageComposer::TO, *it, false) ;
} }
calculateGroupsOfSslIds(groupInfoList, msgInfo.msgcc, groupIds); calculateGroupsOfSslIds(groupInfoList, msgInfo.msgcc, groupIds);
for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) { for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
addRecipient(MessageComposer::CC, *groupIt, true) ; msgComposer->addRecipient(MessageComposer::CC, *groupIt, true) ;
} }
for (it = msgInfo.msgcc.begin(); it != msgInfo.msgcc.end(); it++ ) { for (it = msgInfo.msgcc.begin(); it != msgInfo.msgcc.end(); it++ ) {
addRecipient(MessageComposer::CC, *it, false) ; msgComposer->addRecipient(MessageComposer::CC, *it, false) ;
} }
calculateGroupsOfSslIds(groupInfoList, msgInfo.msgbcc, groupIds); calculateGroupsOfSslIds(groupInfoList, msgInfo.msgbcc, groupIds);
for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) { for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
addRecipient(MessageComposer::BCC, *groupIt, true) ; msgComposer->addRecipient(MessageComposer::BCC, *groupIt, true) ;
} }
for (it = msgInfo.msgbcc.begin(); it != msgInfo.msgbcc.end(); it++ ) { for (it = msgInfo.msgbcc.begin(); it != msgInfo.msgbcc.end(); it++ ) {
addRecipient(MessageComposer::BCC, *it, false) ; msgComposer->addRecipient(MessageComposer::BCC, *it, false) ;
} }
ui.msgText->document()->setModified(false); msgComposer->ui.msgText->document()->setModified(false);
} else { } else {
insertTitleText(tr("No Title").toStdString()); msgComposer->insertTitleText(tr("No Title"));
} }
calculateTitle(); msgComposer->calculateTitle();
return msgComposer;
} }
void MessageComposer::insertTitleText(std::string title) MessageComposer *MessageComposer::replyMsg(const std::string &msgId, bool all)
{ {
ui.titleEdit->setText(QString::fromStdString(title)); MessageInfo msgInfo;
if (!rsMsgs->getMessage(msgId, msgInfo)) {
return NULL;
}
MessageComposer *msgComposer = MessageComposer::newMsg();
msgComposer->m_msgParentId = msgId;
msgComposer->m_msgType = REPLY;
/* fill it in */
msgComposer->insertTitleText(QString::fromStdWString(msgInfo.title), REPLY);
QTextDocument doc ;
doc.setHtml(QString::fromStdWString(msgInfo.msg));
msgComposer->insertPastedText(doc.toPlainText());
msgComposer->addRecipient(MessageComposer::TO, msgInfo.srcId, false);
if (all) {
std::string ownId = rsPeers->getOwnId();
for (std::list<std::string>::iterator tli = msgInfo.msgto.begin(); tli != msgInfo.msgto.end(); tli++) {
if (ownId != *tli) {
msgComposer->addRecipient(MessageComposer::TO, *tli, false) ;
}
}
for (std::list<std::string>::iterator tli = msgInfo.msgcc.begin(); tli != msgInfo.msgcc.end(); tli++) {
if (ownId != *tli) {
msgComposer->addRecipient(MessageComposer::TO, *tli, false) ;
}
}
}
msgComposer->calculateTitle();
/* window will destroy itself! */
return msgComposer;
} }
void MessageComposer::insertPastedText(std::string msg) MessageComposer *MessageComposer::forwardMsg(const std::string &msgId)
{ {
std::string::size_type i=0 ; MessageInfo msgInfo;
while( (i=msg.find_first_of('\n',i+1)) < msg.size()) if (!rsMsgs->getMessage(msgId, msgInfo)) {
msg.replace(i,1,std::string("\n<BR/>> ")) ; return NULL;
}
ui.msgText->setHtml(QString("<HTML><font color=\"blue\">")+QString::fromStdString(std::string("> ") + msg)+"</font><br/><br/></HTML>") ; MessageComposer *msgComposer = MessageComposer::newMsg();
msgComposer->m_msgParentId = msgId;
msgComposer->m_msgType = FORWARD;
/* fill it in */
msgComposer->insertTitleText(QString::fromStdWString(msgInfo.title), FORWARD);
QTextDocument doc ;
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
msgComposer->insertForwardPastedText(doc.toPlainText());
std::list<FileInfo>& files_info = msgInfo.files;
/* enable all files for sending */
std::list<FileInfo>::iterator it;
for(it = files_info.begin(); it != files_info.end(); it++)
{
it->inRecommend = true;
}
msgComposer->insertFileList(files_info);
msgComposer->calculateTitle();
/* window will destroy itself! */
return msgComposer;
}
void MessageComposer::insertTitleText(const QString &title, enumMessageType type)
{
QString titleText;
switch (type) {
case NORMAL:
titleText = title;
break;
case REPLY:
if (title.startsWith("Re:", Qt::CaseInsensitive)) {
titleText = title;
} else {
titleText = tr("Re:") + " " + title;
}
break;
case FORWARD:
if (title.startsWith("Fwd:", Qt::CaseInsensitive)) {
titleText = title;
} else {
titleText = tr("Fwd:") + " " + title;
}
break;
}
ui.titleEdit->setText(titleText);
}
void MessageComposer::insertPastedText(QString msg)
{
msg.replace("\n", "\n<BR/>> ");
ui.msgText->setHtml("<HTML><font color=\"blue\"> > " + msg + "</font><br/><br/></HTML>");
ui.msgText->setFocus( Qt::OtherFocusReason ); ui.msgText->setFocus( Qt::OtherFocusReason );
@ -915,13 +1023,11 @@ void MessageComposer::insertPastedText(std::string msg)
ui.msgText->document()->setModified(true); ui.msgText->document()->setModified(true);
} }
void MessageComposer::insertForwardPastedText(std::string msg) void MessageComposer::insertForwardPastedText(QString msg)
{ {
std::string::size_type i=0 ; msg.replace("\n", "\n<BR/>> ");
while( (i=msg.find_first_of('\n',i+1)) < msg.size())
msg.replace(i,1,std::string("\n<BR/>> ")) ;
ui.msgText->setHtml(QString("<HTML><blockquote [type=cite]><font color=\"blue\">")+QString::fromStdString(std::string("") + msg)+"</font><br/><br/></blockquote></HTML>") ; ui.msgText->setHtml("<HTML><blockquote [type=cite]><font color=\"blue\">> " + msg + "</font><br/><br/></blockquote></HTML>");
ui.msgText->setFocus( Qt::OtherFocusReason ); ui.msgText->setFocus( Qt::OtherFocusReason );
@ -932,9 +1038,9 @@ void MessageComposer::insertForwardPastedText(std::string msg)
ui.msgText->document()->setModified(true); ui.msgText->document()->setModified(true);
} }
void MessageComposer::insertMsgText(std::string msg) void MessageComposer::insertMsgText(const QString &msg)
{ {
ui.msgText->setText(QString::fromStdString(msg)); ui.msgText->setText(msg);
ui.msgText->setFocus( Qt::OtherFocusReason ); ui.msgText->setFocus( Qt::OtherFocusReason );
@ -945,9 +1051,9 @@ void MessageComposer::insertMsgText(std::string msg)
ui.msgText->document()->setModified(true); ui.msgText->document()->setModified(true);
} }
void MessageComposer::insertHtmlText(std::string msg) void MessageComposer::insertHtmlText(const QString &msg)
{ {
ui.msgText->setHtml(QString("<a href='") + QString::fromStdString(std::string(msg + "'> ") ) + QString::fromStdString(std::string(msg)) + "</a>") ; ui.msgText->setHtml("<a href='" + msg + "'> " + msg + "</a>");
ui.msgText->document()->setModified(true); ui.msgText->document()->setModified(true);
} }
@ -1058,17 +1164,47 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
if (bDraftbox) { if (bDraftbox) {
mi.msgId = m_sDraftMsgId; mi.msgId = m_sDraftMsgId;
rsMsgs->MessageToDraft(mi);
rsMsgs->MessageToDraft(mi, m_msgParentId);
// use new message id // use new message id
m_sDraftMsgId = mi.msgId; m_sDraftMsgId = mi.msgId;
switch (m_msgType) {
case NORMAL:
break;
case REPLY:
rsMsgs->MessageReplied(m_sDraftMsgId, true);
break;
case FORWARD:
rsMsgs->MessageForwarded(m_sDraftMsgId, true);
break;
}
// PROBLEM: message to set reply/forwarded get lost
} else { } else {
/* check for the recipient */ /* check for the recipient */
if (mi.msgto.empty()) { if (mi.msgto.empty()) {
QMessageBox::warning(this, tr("RetroShare"), tr("Please insert at least one recipient."), QMessageBox::Ok); QMessageBox::warning(this, tr("RetroShare"), tr("Please insert at least one recipient."), QMessageBox::Ok);
return false; // Don't send with no recipient return false; // Don't send with no recipient
} }
rsMsgs->MessageSend(mi);
if (rsMsgs->MessageSend(mi) == false) {
return false;
}
if (m_msgParentId.empty() == false) {
switch (m_msgType) {
case NORMAL:
break;
case REPLY:
rsMsgs->MessageReplied(m_msgParentId, true);
break;
case FORWARD:
rsMsgs->MessageForwarded(m_msgParentId, true);
break;
}
}
} }
ui.msgText->document()->setModified(false); ui.msgText->document()->setModified(false);
@ -1748,7 +1884,6 @@ void MessageComposer::saveasDraft()
sendMessage_internal(true); sendMessage_internal(true);
} }
void MessageComposer::filePrint() void MessageComposer::filePrint()
{ {
#ifndef QT_NO_PRINTER #ifndef QT_NO_PRINTER

View file

@ -40,6 +40,7 @@ class MessageComposer : public QMainWindow
public: public:
enum enumType { TO, CC, BCC }; enum enumType { TO, CC, BCC };
enum enumMessageType { NORMAL, REPLY, FORWARD };
public: public:
/** Default Constructor */ /** Default Constructor */
@ -50,22 +51,23 @@ public:
static void msgFriend(std::string id, bool group); static void msgFriend(std::string id, bool group);
static void recommendFriend(std::list <std::string> &peerids); static void recommendFriend(std::list <std::string> &peerids);
void newMsg(std::string msgId = ""); static MessageComposer *newMsg(const std::string &msgId = "");
static MessageComposer *replyMsg(const std::string &msgId, bool all);
static MessageComposer *forwardMsg(const std::string &msgId);
/* worker fns */ /* worker fns */
void insertSendList(); void insertSendList();
void insertFileList(const std::list<DirDetails>&); void insertFileList(const std::list<DirDetails>&);
void insertFileList(const std::list<FileInfo>&); void insertFileList(const std::list<FileInfo>&);
void insertTitleText(std::string title); void insertTitleText(const QString &title, enumMessageType type = NORMAL);
void insertPastedText(std::string msg) ; void insertPastedText(QString msg) ;
void insertForwardPastedText(std::string msg); void insertForwardPastedText(QString msg);
void insertHtmlText(std::string msg); void insertHtmlText(const QString &msg);
void insertMsgText(std::string msg); void insertMsgText(const QString &msg);
void addRecipient(enumType type, const std::string &id, bool group); void addRecipient(enumType type, const std::string &id, bool group);
void Create_New_Image_Tag(const QString urlremoteorlocal); void Create_New_Image_Tag(const QString urlremoteorlocal);
public slots: public slots:
/* actions to take.... */ /* actions to take.... */
void sendMessage(); void sendMessage();
void cancelMessage(); void cancelMessage();
@ -73,7 +75,6 @@ public slots:
void changeFormatType(int styleIndex ); void changeFormatType(int styleIndex );
protected: protected:
void closeEvent (QCloseEvent * event); void closeEvent (QCloseEvent * event);
bool eventFilter(QObject *obj, QEvent *ev); bool eventFilter(QObject *obj, QEvent *ev);
@ -191,8 +192,9 @@ private:
QHash<QString, QString> autoLinkTitleDictionary; QHash<QString, QString> autoLinkTitleDictionary;
QHash<QString, int> autoLinkTargetDictionary; QHash<QString, int> autoLinkTargetDictionary;
std::string m_sMsgId; // existing message id std::string m_msgParentId; // parent message id
std::string m_sDraftMsgId; // existing message id std::string m_sDraftMsgId; // existing message id
enumMessageType m_msgType;
/* maps of files */ /* maps of files */
std::list<AttachFileItem *> mAttachments; std::list<AttachFileItem *> mAttachments;

View file

@ -1183,7 +1183,7 @@ Verfügbar: %3</translation>
<translation>Abbrechen</translation> <translation>Abbrechen</translation>
</message> </message>
<message> <message>
<location filename="../gui/feeds/ChatMsgItem.cpp" line="+272"/> <location filename="../gui/feeds/ChatMsgItem.cpp" line="+274"/>
<source>Quick Message</source> <source>Quick Message</source>
<translation>Schnelle Nachrricht</translation> <translation>Schnelle Nachrricht</translation>
</message> </message>
@ -3550,27 +3550,22 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+487"/> <location line="+487"/>
<location line="+91"/> <location line="+88"/>
<source>RetroShare</source> <source>RetroShare</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="-91"/> <location line="-88"/>
<source>No Forum Selected!</source> <source>No Forum Selected!</source>
<translation>Kein Forum ausgewählt!</translation> <translation>Kein Forum ausgewählt!</translation>
</message> </message>
<message> <message>
<location line="+76"/> <location line="+88"/>
<source>Re:</source>
<translation></translation>
</message>
<message>
<location line="+15"/>
<source>You cant reply a Anonymous Author</source> <source>You cant reply a Anonymous Author</source>
<translation>Du kannst einem anonymen Autor nicht antworten</translation> <translation>Du kannst einem anonymen Autor nicht antworten</translation>
</message> </message>
<message> <message>
<location line="-1489"/> <location line="-1486"/>
<source>Your Forums</source> <source>Your Forums</source>
<translation>Deine Foren</translation> <translation>Deine Foren</translation>
</message> </message>
@ -5289,8 +5284,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
<name>MessageComposer</name> <name>MessageComposer</name>
<message> <message>
<location filename="../gui/msgs/MessageComposer.ui" line="+17"/> <location filename="../gui/msgs/MessageComposer.ui" line="+17"/>
<location filename="../gui/msgs/MessageComposer.cpp" line="+389"/> <location filename="../gui/msgs/MessageComposer.cpp" line="+737"/>
<location line="+344"/>
<source>Compose</source> <source>Compose</source>
<translation>Verfassen</translation> <translation>Verfassen</translation>
</message> </message>
@ -5432,7 +5426,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
<translation>Setzt Schriftart auf Codestil</translation> <translation>Setzt Schriftart auf Codestil</translation>
</message> </message>
<message> <message>
<location filename="../gui/msgs/MessageComposer.cpp" line="+397"/> <location filename="../gui/msgs/MessageComposer.cpp" line="+529"/>
<source>To</source> <source>To</source>
<translation>An</translation> <translation>An</translation>
</message> </message>
@ -5522,7 +5516,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
<translation>Blockquote hinzufügen</translation> <translation>Blockquote hinzufügen</translation>
</message> </message>
<message> <message>
<location filename="../gui/msgs/MessageComposer.cpp" line="-939"/> <location filename="../gui/msgs/MessageComposer.cpp" line="-1073"/>
<source>&amp;Left</source> <source>&amp;Left</source>
<translation>&amp;Links</translation> <translation>&amp;Links</translation>
</message> </message>
@ -5542,36 +5536,46 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
<translation>&amp;Blocksatz</translation> <translation>&amp;Blocksatz</translation>
</message> </message>
<message> <message>
<location line="+209"/> <location line="+211"/>
<location line="+1410"/> <location line="+1541"/>
<source>Save Message</source> <source>Save Message</source>
<translation>Nachricht speichern</translation> <translation>Nachricht speichern</translation>
</message> </message>
<message> <message>
<location line="-1409"/> <location line="-1540"/>
<source>Message has not been Sent. <source>Message has not been Sent.
Do you want to save message to draft box?</source> Do you want to save message to draft box?</source>
<translation>Nachricht wurde noch nicht gesendet. <translation>Nachricht wurde noch nicht gesendet.
Möchtest Du die Nachricht in den Entwürfen speichern?</translation> Möchtest Du die Nachricht in den Entwürfen speichern?</translation>
</message> </message>
<message> <message>
<location line="+560"/> <location line="+580"/>
<location line="+96"/> <source>Re:</source>
<translation>Re:</translation>
</message>
<message>
<location line="+7"/>
<source>Fwd:</source>
<translation>Fwd:</translation>
</message>
<message>
<location line="+75"/>
<location line="+110"/>
<source>RetroShare</source> <source>RetroShare</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="-96"/> <location line="-110"/>
<source>Do you want to send the message without a subject ?</source> <source>Do you want to send the message without a subject ?</source>
<translation>Möchtest Du die Nachricht ohne Betreff senden ?</translation> <translation>Möchtest Du die Nachricht ohne Betreff senden ?</translation>
</message> </message>
<message> <message>
<location line="+96"/> <location line="+110"/>
<source>Please insert at least one recipient.</source> <source>Please insert at least one recipient.</source>
<translation>Bitte geben sie mindestens einen Empfänger ein.</translation> <translation>Bitte geben sie mindestens einen Empfänger ein.</translation>
</message> </message>
<message> <message>
<location line="+96"/> <location line="+112"/>
<source>Unknown</source> <source>Unknown</source>
<translation>Unbekannt</translation> <translation>Unbekannt</translation>
</message> </message>
@ -5702,7 +5706,7 @@ Möchtest Du die Nachricht in den Entwürfen speichern?</translation>
<translation>Speichern unter...</translation> <translation>Speichern unter...</translation>
</message> </message>
<message> <message>
<location line="+22"/> <location line="+21"/>
<source>Print Document</source> <source>Print Document</source>
<translation>Dokument drucken</translation> <translation>Dokument drucken</translation>
</message> </message>
@ -5729,12 +5733,7 @@ Willst Du die Nachricht speichern ?</translation>
<translation>Zusätzliche Datei hinzufügen</translation> <translation>Zusätzliche Datei hinzufügen</translation>
</message> </message>
<message> <message>
<location line="-1572"/> <location line="-1702"/>
<source>Friend Recommendation</source>
<translation>Freundempfehlung</translation>
</message>
<message>
<location line="+1"/>
<source>Friend Recommendation(s)</source> <source>Friend Recommendation(s)</source>
<translation>Freundempfehlung(en)</translation> <translation>Freundempfehlung(en)</translation>
</message> </message>
@ -5834,7 +5833,7 @@ Willst Du die Nachricht speichern ?</translation>
<name>MessagesDialog</name> <name>MessagesDialog</name>
<message> <message>
<location filename="../gui/MessagesDialog.ui" line="+573"/> <location filename="../gui/MessagesDialog.ui" line="+573"/>
<location filename="../gui/MessagesDialog.cpp" line="+692"/> <location filename="../gui/MessagesDialog.cpp" line="+693"/>
<source>New Message</source> <source>New Message</source>
<translation>Neue Nachricht</translation> <translation>Neue Nachricht</translation>
</message> </message>
@ -5857,7 +5856,7 @@ Willst Du die Nachricht speichern ?</translation>
<message> <message>
<location line="-5"/> <location line="-5"/>
<location filename="../gui/MessagesDialog.cpp" line="-1"/> <location filename="../gui/MessagesDialog.cpp" line="-1"/>
<location line="+928"/> <location line="+841"/>
<source>From</source> <source>From</source>
<translation>Von</translation> <translation>Von</translation>
</message> </message>
@ -5942,15 +5941,15 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location line="+177"/> <location line="+177"/>
<location filename="../gui/MessagesDialog.cpp" line="-44"/> <location filename="../gui/MessagesDialog.cpp" line="-44"/>
<location line="+983"/> <location line="+995"/>
<location line="+10"/> <location line="+10"/>
<source>Inbox</source> <source>Inbox</source>
<translation>Posteingang</translation> <translation>Posteingang</translation>
</message> </message>
<message> <message>
<location line="+9"/> <location line="+9"/>
<location filename="../gui/MessagesDialog.cpp" line="-988"/> <location filename="../gui/MessagesDialog.cpp" line="-1000"/>
<location line="+1001"/> <location line="+1013"/>
<location line="+8"/> <location line="+8"/>
<source>Outbox</source> <source>Outbox</source>
<translation>Postausgang</translation> <translation>Postausgang</translation>
@ -5962,7 +5961,7 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+9"/> <location line="+9"/>
<location filename="../gui/MessagesDialog.cpp" line="-999"/> <location filename="../gui/MessagesDialog.cpp" line="-1011"/>
<source>Sent</source> <source>Sent</source>
<translation>Gesendet</translation> <translation>Gesendet</translation>
</message> </message>
@ -6024,13 +6023,13 @@ p, li { white-space: pre-wrap; }
<translation>Speichern unter...</translation> <translation>Speichern unter...</translation>
</message> </message>
<message> <message>
<location filename="../gui/MessagesDialog.cpp" line="+748"/> <location filename="../gui/MessagesDialog.cpp" line="+760"/>
<source>Print Document</source> <source>Print Document</source>
<translation>Dokument drucken</translation> <translation>Dokument drucken</translation>
</message> </message>
<message> <message>
<location filename="../gui/MessagesDialog.ui" line="-891"/> <location filename="../gui/MessagesDialog.ui" line="-891"/>
<location filename="../gui/MessagesDialog.cpp" line="-1649"/> <location filename="../gui/MessagesDialog.cpp" line="-1574"/>
<source>Subject</source> <source>Subject</source>
<translation>Betreff</translation> <translation>Betreff</translation>
</message> </message>
@ -6090,19 +6089,7 @@ p, li { white-space: pre-wrap; }
<translation>Herunterladen</translation> <translation>Herunterladen</translation>
</message> </message>
<message> <message>
<location line="+96"/> <location line="+140"/>
<location line="+47"/>
<source>Compose: </source>
<translation>Verfassen: </translation>
</message>
<message>
<location line="-47"/>
<location line="+47"/>
<source>Re:</source>
<translation></translation>
</message>
<message>
<location line="+90"/>
<source>Hide</source> <source>Hide</source>
<translation>Empfohlene Dateien ausblenden</translation> <translation>Empfohlene Dateien ausblenden</translation>
</message> </message>
@ -6112,7 +6099,7 @@ p, li { white-space: pre-wrap; }
<translation>Empfohlene Dateien einblenden</translation> <translation>Empfohlene Dateien einblenden</translation>
</message> </message>
<message> <message>
<location line="+1031"/> <location line="+1049"/>
<source>Save as...</source> <source>Save as...</source>
<translation>Speichern unter...</translation> <translation>Speichern unter...</translation>
</message> </message>
@ -6122,7 +6109,7 @@ p, li { white-space: pre-wrap; }
<translation>HTML-Dateien (*.htm *.html);;Alle Dateien (*)</translation> <translation>HTML-Dateien (*.htm *.html);;Alle Dateien (*)</translation>
</message> </message>
<message> <message>
<location line="-1633"/> <location line="-1558"/>
<location line="+272"/> <location line="+272"/>
<source>Reply to All</source> <source>Reply to All</source>
<translation>Allen antworten</translation> <translation>Allen antworten</translation>
@ -6161,8 +6148,8 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+177"/> <location line="+177"/>
<location filename="../gui/MessagesDialog.cpp" line="+724"/> <location filename="../gui/MessagesDialog.cpp" line="+637"/>
<location line="+1025"/> <location line="+1037"/>
<location line="+5"/> <location line="+5"/>
<source>Trash</source> <source>Trash</source>
<translation>Papierkorb</translation> <translation>Papierkorb</translation>
@ -6178,7 +6165,7 @@ p, li { white-space: pre-wrap; }
<translation>Ordner</translation> <translation>Ordner</translation>
</message> </message>
<message> <message>
<location filename="../gui/MessagesDialog.cpp" line="-1743"/> <location filename="../gui/MessagesDialog.cpp" line="-1668"/>
<source>Remove All Tags</source> <source>Remove All Tags</source>
<translation>Alle Schlagwörter entfernen</translation> <translation>Alle Schlagwörter entfernen</translation>
</message> </message>
@ -6208,34 +6195,24 @@ p, li { white-space: pre-wrap; }
<translation>Papierkorb leeren</translation> <translation>Papierkorb leeren</translation>
</message> </message>
<message> <message>
<location line="+179"/> <location line="+367"/>
<source>Compose:</source> <location line="+1028"/>
<translation>Verfassen:</translation>
</message>
<message>
<location line="+0"/>
<source>Fwd:</source>
<translation></translation>
</message>
<message>
<location line="+275"/>
<location line="+1016"/>
<location line="+8"/> <location line="+8"/>
<source>Drafts</source> <source>Drafts</source>
<translation>Entwürfe</translation> <translation>Entwürfe</translation>
</message> </message>
<message> <message>
<location line="-988"/> <location line="-1000"/>
<source>To</source> <source>To</source>
<translation>An</translation> <translation>An</translation>
</message> </message>
<message> <message>
<location line="-591"/> <location line="-504"/>
<source>Edit...</source> <source>Edit...</source>
<translation>Editieren...</translation> <translation>Editieren...</translation>
</message> </message>
<message> <message>
<location line="+1499"/> <location line="+1424"/>
<location line="+4"/> <location line="+4"/>
<location line="+4"/> <location line="+4"/>
<location line="+4"/> <location line="+4"/>
@ -6421,17 +6398,12 @@ p, li { white-space: pre-wrap; }
<translation>Medium abspielen</translation> <translation>Medium abspielen</translation>
</message> </message>
<message> <message>
<location filename="../gui/feeds/MsgItem.cpp" line="+61"/> <location line="-56"/>
<source>Re: </source>
<translation>Re: </translation>
</message>
<message>
<location filename="../gui/feeds/MsgItem.ui" line="-56"/>
<source>Reply Message</source> <source>Reply Message</source>
<translation>Auf Nachricht antworten</translation> <translation>Auf Nachricht antworten</translation>
</message> </message>
<message> <message>
<location filename="../gui/feeds/MsgItem.cpp" line="-67"/> <location filename="../gui/feeds/MsgItem.cpp" line="-6"/>
<source>Hide</source> <source>Hide</source>
<translation>Verbergen</translation> <translation>Verbergen</translation>
</message> </message>
@ -7226,7 +7198,7 @@ p, li { white-space: pre-wrap; }
<translation>Verbergen</translation> <translation>Verbergen</translation>
</message> </message>
<message> <message>
<location line="+138"/> <location line="+140"/>
<source>Quick Message</source> <source>Quick Message</source>
<translation>Schnelle Nachrricht</translation> <translation>Schnelle Nachrricht</translation>
</message> </message>
@ -7377,7 +7349,13 @@ p, li { white-space: pre-wrap; }
<translation>Verfügbar</translation> <translation>Verfügbar</translation>
</message> </message>
<message> <message>
<location line="+784"/> <location line="+421"/>
<location line="+2"/>
<source>New group chat</source>
<translation>Neuer Gruppenchat</translation>
</message>
<message>
<location line="+361"/>
<source>Add Extra File</source> <source>Add Extra File</source>
<translation>Zusätzliche Datei hinzufügen</translation> <translation>Zusätzliche Datei hinzufügen</translation>
</message> </message>
@ -7436,12 +7414,7 @@ p, li { white-space: pre-wrap; }
<translation>Statusnachricht ändern</translation> <translation>Statusnachricht ändern</translation>
</message> </message>
<message> <message>
<location line="+38"/> <location line="+232"/>
<source>Live Chat</source>
<translation></translation>
</message>
<message>
<location line="+194"/>
<source>Bold</source> <source>Bold</source>
<translation>Fett</translation> <translation>Fett</translation>
</message> </message>
@ -7510,7 +7483,12 @@ p, li { white-space: pre-wrap; }
<translation>Schriftart</translation> <translation>Schriftart</translation>
</message> </message>
<message> <message>
<location line="+35"/> <location line="-308"/>
<source>Group Chat</source>
<translation>Gruppenchat</translation>
</message>
<message>
<location line="+343"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
@ -9221,6 +9199,11 @@ p, li { white-space: pre-wrap; }
<source>Folder</source> <source>Folder</source>
<translation>Ordner</translation> <translation>Ordner</translation>
</message> </message>
<message>
<location line="+456"/>
<source>New RetroShare Link(s)</source>
<translation>Neu(e) RetroShare Link(s)</translation>
</message>
<message> <message>
<location filename="../gui/SearchDialog.ui" line="-583"/> <location filename="../gui/SearchDialog.ui" line="-583"/>
<source>Any</source> <source>Any</source>
@ -9267,7 +9250,7 @@ p, li { white-space: pre-wrap; }
<translation>Such ID</translation> <translation>Such ID</translation>
</message> </message>
<message> <message>
<location filename="../gui/SearchDialog.cpp" line="-458"/> <location filename="../gui/SearchDialog.cpp" line="-914"/>
<source>Download Notice</source> <source>Download Notice</source>
<translation>Download</translation> <translation>Download</translation>
</message> </message>
@ -9964,22 +9947,22 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location filename="../gui/SharedFilesDialog.cpp" line="-68"/> <location filename="../gui/SharedFilesDialog.cpp" line="-68"/>
<location line="+595"/> <location line="+610"/>
<source>Open File</source> <source>Open File</source>
<translation>Datei öffnen</translation> <translation>Datei öffnen</translation>
</message> </message>
<message> <message>
<location line="-593"/> <location line="-608"/>
<source>Open Folder</source> <source>Open Folder</source>
<translation>Ordner öffnen</translation> <translation>Ordner öffnen</translation>
</message> </message>
<message> <message>
<location line="+602"/> <location line="+617"/>
<source>Set command for opening this file</source> <source>Set command for opening this file</source>
<translation>Setze eine Regel zum Öffnen dieser Datei</translation> <translation>Setze eine Regel zum Öffnen dieser Datei</translation>
</message> </message>
<message> <message>
<location line="-533"/> <location line="-548"/>
<source>Copy retroshare Link</source> <source>Copy retroshare Link</source>
<translation>Kopiere RetroShare Link</translation> <translation>Kopiere RetroShare Link</translation>
</message> </message>
@ -9999,7 +9982,17 @@ p, li { white-space: pre-wrap; }
<translation>Sende RetroShare Link</translation> <translation>Sende RetroShare Link</translation>
</message> </message>
<message> <message>
<location line="+437"/> <location line="+325"/>
<source>%1 recommends a list of files to you</source>
<translation>%1 empfiehlt Dir eine Liste von Dateien</translation>
</message>
<message>
<location line="+2"/>
<source>%1 recommends a file to you</source>
<translation>%1 empfiehlt Dir eine Datei</translation>
</message>
<message>
<location line="+125"/>
<source>Recommend (Automated message) To </source> <source>Recommend (Automated message) To </source>
<translation>Empfehle (automatisch) in einer Nachricht an </translation> <translation>Empfehle (automatisch) in einer Nachricht an </translation>
</message> </message>
@ -10009,7 +10002,7 @@ p, li { white-space: pre-wrap; }
<translation>Empfehle in einer Nachricht an </translation> <translation>Empfehle in einer Nachricht an </translation>
</message> </message>
<message> <message>
<location line="-525"/> <location line="-540"/>
<source>Copy retroshare Links to Clipboard</source> <source>Copy retroshare Links to Clipboard</source>
<translation>Kopiere RetroShare Links in die Zwischenablage</translation> <translation>Kopiere RetroShare Links in die Zwischenablage</translation>
</message> </message>
@ -10039,7 +10032,21 @@ p, li { white-space: pre-wrap; }
<translation>Füge die Links zur Verknüpfungs-Wolke hinzu</translation> <translation>Füge die Links zur Verknüpfungs-Wolke hinzu</translation>
</message> </message>
<message> <message>
<location line="+666"/> <location line="+213"/>
<location line="+23"/>
<location line="+24"/>
<source>RetroShare Link</source>
<translation>RetroShare Link</translation>
</message>
<message>
<location line="+137"/>
<location line="+33"/>
<location line="+1"/>
<source>Recommendation(s)</source>
<translation>Empfehlung(en)</translation>
</message>
<message>
<location line="+250"/>
<source>&lt;strong&gt;My Shared Files&lt;/strong&gt;</source> <source>&lt;strong&gt;My Shared Files&lt;/strong&gt;</source>
<translation>&lt;strong&gt;Meine Dateien&lt;/strong&gt;</translation> <translation>&lt;strong&gt;Meine Dateien&lt;/strong&gt;</translation>
</message> </message>