mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 14:23:36 -05:00
add date to chat msg if it is mroe than 1 day old
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6510 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ed9b6e0784
commit
36ea99da03
@ -71,6 +71,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
||||
firstShow = true;
|
||||
inChatCharFormatChanged = false;
|
||||
completer = NULL;
|
||||
lastMsgDate = QDate::currentDate();
|
||||
|
||||
lastStatusSendTime = 0 ;
|
||||
|
||||
@ -512,6 +513,13 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
|
||||
unsigned int formatTextFlag = RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_OPTIMIZE;
|
||||
unsigned int formatFlag = 0;
|
||||
|
||||
bool addDate = false;
|
||||
if (QDate::currentDate()>lastMsgDate)
|
||||
{
|
||||
lastMsgDate=QDate::currentDate();
|
||||
addDate=true;
|
||||
}
|
||||
|
||||
// embed smileys ?
|
||||
if (Settings->valueFromGroup(QString("Chat"), QString::fromUtf8("Emoteicons_PrivatChat"), true).toBool()) {
|
||||
formatTextFlag |= RSHTML_FORMATTEXT_EMBED_SMILEYS;
|
||||
@ -541,7 +549,7 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
|
||||
type = ChatStyle::FORMATMSG_OOUTGOING;
|
||||
} else if (chatType == TYPE_SYSTEM) {
|
||||
type = ChatStyle::FORMATMSG_SYSTEM;
|
||||
} else if (chatType == TYPE_HISTORY) {
|
||||
} else if (chatType == TYPE_HISTORY || addDate) {
|
||||
type = incoming ? ChatStyle::FORMATMSG_HINCOMING : ChatStyle::FORMATMSG_HOUTGOING;
|
||||
} else {
|
||||
type = incoming ? ChatStyle::FORMATMSG_INCOMING : ChatStyle::FORMATMSG_OUTGOING;
|
||||
|
@ -164,6 +164,7 @@ private:
|
||||
bool inChatCharFormatChanged;
|
||||
|
||||
TransferRequestFlags mDefaultExtraFileFlags ; // flags for extra files shared in this chat. Will be 0 by default, but might be ANONYMOUS for chat lobbies.
|
||||
QDate lastMsgDate ;
|
||||
|
||||
QCompleter *completer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user