*************** *** 958,974 **** void ChatDlg::appendSysMsg(const QString &str) { QString timestr; - QDateTime time = QDateTime::currentDateTime(); QColor bgcolor = option.color[cChatBGself]; - //timestr.sprintf("%02d:%02d:%02d", time.time().hour(), time.time().minute(), time.time().second()); - timestr = time.time().toString(LocalDate); int y = d->log->contentsHeight() - d->log->visibleHeight(); if(y < 0) y = 0; bool atBottom = (d->log->contentsY() < y - 32) ? false: true; - appendParagraph (QString("[%1]").arg(timestr) + QString(" *** %1").arg(str), bgcolor); if(atBottom) deferredScroll(); } --- 958,977 ---- void ChatDlg::appendSysMsg(const QString &str) { QString timestr; QColor bgcolor = option.color[cChatBGself]; + + if(option.showTimeStamps) + { + QDateTime time = QDateTime::currentDateTime(); + timestr = QString("(") + time.time().toString(LocalDate) + ") "; + } int y = d->log->contentsHeight() - d->log->visibleHeight(); if(y < 0) y = 0; bool atBottom = (d->log->contentsY() < y - 32) ? false: true; + appendParagraph (QString("") + timestr + QString(" *** %1").arg(str), bgcolor); if(atBottom) deferredScroll(); } *************** *** 1020,1027 **** } QString timestr; - QDateTime time = m.timeStamp(); - timestr = time.time().toString(LocalDate); int y = d->log->contentsHeight() - d->log->visibleHeight(); if(y < 0) --- 1028,1043 ---- } QString timestr; + if(option.showTimeStamps) + { + QDateTime mytime = QDateTime::currentDateTime(); + QDateTime time = m.timeStamp(); + // same day or not more than last 30 minutes + if (time.date() == mytime.date() && time.addSecs(1800) >= mytime) + timestr = QString("(") + time.time().toString(LocalDate) + ") "; + else + timestr = QString("(") + time.toString(LocalDate) + ") "; + } int y = d->log->contentsHeight() - d->log->visibleHeight(); if(y < 0) *************** *** 1043,1063 **** if(option.useEmoticons && option.emoticonsInChatDlg) txt = emoticonify(txt); - if(!emote) - txt = QString("").arg(txtcolor) + txt +""; - who = expandEntities(who); if(emote) { - appendParagraph (QString("").arg(color) + QString("[%1]").arg(timestr) + QString(" *%1 ").arg(who) + txt + "", bgcolor); } else { if(option.chatSays) { QString chatmsgtxt; if (!option.chatSaysMerge || d->lastSays != lastSaysEnum(local)) { - chatmsgtxt = QString("").arg(color) + QString("[%1] ").arg(timestr) + tr("%1 says:").arg(who) + "
" + txt; d->lastSays = lastSaysEnum(local); } else --- 1059,1078 ---- if(option.useEmoticons && option.emoticonsInChatDlg) txt = emoticonify(txt); who = expandEntities(who); if(emote) { + appendParagraph (QString("").arg(color) + timestr + QString("**%1 ").arg(who) + txt + "", bgcolor); } else { + txt = QString("").arg(txtcolor) + txt +""; + if(option.chatSays) { QString chatmsgtxt; if (!option.chatSaysMerge || d->lastSays != lastSaysEnum(local)) { + chatmsgtxt = QString("").arg(color) + timestr + tr("%1 says:").arg(who) + "
" + txt; d->lastSays = lastSaysEnum(local); } else *************** *** 1066,1072 **** appendParagraph (chatmsgtxt, bgcolor); } else - appendParagraph (QString("").arg(color) + QString("[%1] <").arg(timestr) + who + QString("> ") + txt, bgcolor); } if(!m.subject().isEmpty()) { d->log->append(QString("") + tr("Subject:") + " " + QString("%1").arg(expandEntities(m.subject()))); --- 1081,1087 ---- appendParagraph (chatmsgtxt, bgcolor); } else + appendParagraph (QString("").arg(color) + timestr + who + QString(": ") + txt, bgcolor); } if(!m.subject().isEmpty()) { d->log->append(QString("") + tr("Subject:") + " " + QString("%1").arg(expandEntities(m.subject())));