Chat service:

- Added send time to ChatInfo.

Chat:
- Reworked IMHistoryKeeper to save only needed data as raw data (not formatted from PeersDialog).
- Renamed the public chat history file from "his1.xml" to "chatPublic.xml" and moved it from data dir to config dir. The current history is lost. Please delete the file "his1.xml" manually.
- Optimized save of the history. Save only when changed, also during the runtime.
- Clear the history in PeersDialog clears the IMHistoryKeeper too.
- New setting to send chat message with Ctrl+Return. Changed the check for Enter in PeersDialog and PopupChatDialog from textChanged to eventFilter.
- Smileys are inserted at the current cursor position, not added at the end.
- Don't send emty messages.

New class ChatStyle:
- Created a new class for the work with chat styles and smileys.
- Currently only two internal styles are available - private and public. Later more external styles planned.
- Moved functions for loading and showing the emoticons from PeersDialog and PopupChatDialog to the new class.

Private chat:
- Split private chat style into incoming.htm and outgoing.htm.
- Removed style change.

Public chat:
- New chat style incoming.htm, outgoing.htm, hincoming.htm and houtgoing.htm.

Chat feed:
- Show links and emoticons if they are enabled for public chat.

PeersDialog:
- Show the own name and location only once at start and not with QTimer every 1.5 second.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3441 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-09-04 14:23:30 +00:00
parent 73f3fa3223
commit 8213a2aa77
33 changed files with 1167 additions and 1061 deletions

View file

@ -26,6 +26,8 @@
#include "FeedHolder.h"
#include "../RsAutoUpdatePage.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/chat/ChatStyle.h"
#include "gui/settings/rsharesettings.h"
#include "gui/notifyqt.h"
@ -137,7 +139,20 @@ void ChatMsgItem::insertChat(std::string &message)
QString timestamp = QDateTime::currentDateTime().toString("hh:mm:ss");
timestampLabel->setText(timestamp);
chatTextlabel->setText(QString::fromStdString(message));
QString formatMsg = QString::fromStdString(message);
ChatStyle style;
unsigned int formatFlag = CHAT_FORMATTEXT_EMBED_LINKS;
// embed smileys ?
if (Settings->valueFromGroup(QString("Chat"), QString::fromUtf8("Emoteicons_GroupChat"), true).toBool()) {
style.loadEmoticons();
formatFlag |= CHAT_FORMATTEXT_EMBED_SMILEYS;
}
formatMsg = style.formatText(formatMsg, formatFlag);
chatTextlabel->setText(formatMsg);
}
void ChatMsgItem::removeItem()