simplification of the chat interface to libretroshare using a single unified class for chat IDs. Used a common chat widget for all chats including broadcast. Opens the way to having plugins send/recv chat messages. Patch from Electron.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7800 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-12-29 21:41:05 +00:00
parent 535fe875e4
commit 13d7866171
53 changed files with 1180 additions and 2280 deletions

View file

@ -34,13 +34,13 @@ class ChatDialog : public QWidget
Q_OBJECT
public:
static ChatDialog *getExistingChat(const RsPeerId &peerId);
static ChatDialog *getChat(const RsPeerId &peerId, uint chatflags);
static ChatDialog *getExistingChat(ChatId id);
static ChatDialog *getChat(ChatId id, uint chatflags = 0);
static void cleanupChat();
static void chatFriend(const RsPeerId &peerId, bool forceFocus = true);
static void chatFriend(const ChatId &peerId, bool forceFocus = true);
static void chatFriend(const RsPgpId &gpgId, bool forceFocus = true);
static void closeChat(const RsPeerId &peerId);
static void chatChanged(int list, int type);
static void closeChat(const ChatId &chat_id);
static void chatMessageReceived(ChatMessage msg);
virtual void showDialog(uint /*chatflags*/) {}
@ -51,7 +51,6 @@ public:
void addToParent(QWidget *newParent);
void removeFromParent(QWidget *oldParent);
RsPeerId getPeerId() { return peerId; }
QString getTitle();
bool hasNewMessages();
bool isTyping();
@ -59,12 +58,13 @@ public:
bool setStyle();
const RSStyle *getStyle();
void insertChatMsgs();
int getPeerStatus();
void setPeerStatus(uint32_t state);
void focusDialog();
ChatId getChatId(){ return mChatId; }
signals:
void infoChanged(ChatDialog *dialog);
void newMessage(ChatDialog *dialog);
@ -81,14 +81,13 @@ protected:
void closeEvent(QCloseEvent *event);
virtual bool canClose() { return true; }
virtual QString getPeerName(const RsPeerId &sslid) const ; // can be overloaded for chat dialogs that have specific peers
virtual QString getPeerName(const ChatId &sslid) const ; // can be overloaded for chat dialogs that have specific peers
virtual QString getOwnName() const;
virtual void init(const RsPeerId &peerId, const QString &title);
virtual void onChatChanged(int /*list*/, int /*type*/) {}
virtual void init(ChatId id, const QString &title);
virtual void addChatMsg(const ChatMessage& msg) = 0;
virtual void addIncomingChatMsg(const ChatInfo& info) = 0;
RsPeerId peerId;
ChatId mChatId;
};
#endif // CHATDIALOG_H