mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-26 16:09:35 -05:00
Merge pull request #1166 from PhenomRetroShare/Add_ChatRoomRSLink
Add Chat Room RSLink
This commit is contained in:
commit
7bb8eb020e
@ -7,6 +7,7 @@
|
|||||||
#include "chat/ChatTabWidget.h"
|
#include "chat/ChatTabWidget.h"
|
||||||
#include "chat/CreateLobbyDialog.h"
|
#include "chat/CreateLobbyDialog.h"
|
||||||
#include "common/RSTreeWidgetItem.h"
|
#include "common/RSTreeWidgetItem.h"
|
||||||
|
#include "gui/RetroShareLink.h"
|
||||||
#include "gui/gxs/GxsIdDetails.h"
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
#include "gui/Identity/IdEditDialog.h"
|
#include "gui/Identity/IdEditDialog.h"
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
@ -58,6 +59,7 @@
|
|||||||
#define IMAGE_TYPING ":images/typing.png"
|
#define IMAGE_TYPING ":images/typing.png"
|
||||||
#define IMAGE_MESSAGE ":images/chat.png"
|
#define IMAGE_MESSAGE ":images/chat.png"
|
||||||
#define IMAGE_AUTOSUBSCRIBE ":images/accepted16.png"
|
#define IMAGE_AUTOSUBSCRIBE ":images/accepted16.png"
|
||||||
|
#define IMAGE_COPYRSLINK ":/images/copyrslink.png"
|
||||||
|
|
||||||
ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
|
ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
|
||||||
: RsAutoUpdatePage(5000, parent, flags)
|
: RsAutoUpdatePage(5000, parent, flags)
|
||||||
@ -321,6 +323,8 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
|
|||||||
contextMnu.addAction(QIcon(IMAGE_AUTOSUBSCRIBE), tr("Remove Auto Subscribe"), this, SLOT(autoSubscribeItem()));
|
contextMnu.addAction(QIcon(IMAGE_AUTOSUBSCRIBE), tr("Remove Auto Subscribe"), this, SLOT(autoSubscribeItem()));
|
||||||
else if(!own_identities.empty())
|
else if(!own_identities.empty())
|
||||||
contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Add Auto Subscribe"), this, SLOT(autoSubscribeItem()));
|
contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Add Auto Subscribe"), this, SLOT(autoSubscribeItem()));
|
||||||
|
|
||||||
|
contextMnu.addAction(QIcon(IMAGE_COPYRSLINK), tr("Copy RetroShare Link"), this, SLOT(copyItemLink()));
|
||||||
}
|
}
|
||||||
|
|
||||||
contextMnu.addSeparator();//-------------------------------------------------------------------
|
contextMnu.addSeparator();//-------------------------------------------------------------------
|
||||||
@ -743,7 +747,7 @@ void ChatLobbyWidget::subscribeChatLobbyAs()
|
|||||||
ChatDialog::chatFriend(ChatId(id),true) ;
|
ChatDialog::chatFriend(ChatId(id),true) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatLobbyWidget::showLobbyAnchor(ChatLobbyId id, QString anchor)
|
bool ChatLobbyWidget::showLobbyAnchor(ChatLobbyId id, QString anchor)
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *item = getTreeWidgetItem(id) ;
|
QTreeWidgetItem *item = getTreeWidgetItem(id) ;
|
||||||
|
|
||||||
@ -758,13 +762,14 @@ void ChatLobbyWidget::showLobbyAnchor(ChatLobbyId id, QString anchor)
|
|||||||
ChatLobbyDialog *cldCW=NULL ;
|
ChatLobbyDialog *cldCW=NULL ;
|
||||||
if (NULL != (cldCW = dynamic_cast<ChatLobbyDialog *>(ui.stackedWidget->currentWidget())))
|
if (NULL != (cldCW = dynamic_cast<ChatLobbyDialog *>(ui.stackedWidget->currentWidget())))
|
||||||
cldCW->getChatWidget()->scrollToAnchor(anchor);
|
cldCW->getChatWidget()->scrollToAnchor(anchor);
|
||||||
|
}
|
||||||
|
|
||||||
ui.lobbyTreeWidget->setCurrentItem(item);
|
ui.lobbyTreeWidget->setCurrentItem(item);
|
||||||
}
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatLobbyWidget::subscribeChatLobbyAtItem(QTreeWidgetItem *item)
|
void ChatLobbyWidget::subscribeChatLobbyAtItem(QTreeWidgetItem *item)
|
||||||
@ -890,6 +895,24 @@ void ChatLobbyWidget::autoSubscribeItem()
|
|||||||
autoSubscribeLobby(ui.lobbyTreeWidget->currentItem());
|
autoSubscribeLobby(ui.lobbyTreeWidget->currentItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChatLobbyWidget::copyItemLink()
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *item = ui.lobbyTreeWidget->currentItem();
|
||||||
|
if (item == NULL || item->type() != TYPE_LOBBY) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ChatLobbyId id = item->data(COLUMN_DATA, ROLE_ID).toULongLong();
|
||||||
|
QString name = item->text(COLUMN_NAME);
|
||||||
|
|
||||||
|
RetroShareLink link = RetroShareLink::createChatRoom(ChatId(id),name);
|
||||||
|
if (link.valid()) {
|
||||||
|
QList<RetroShareLink> urls;
|
||||||
|
urls.push_back(link);
|
||||||
|
RSLinkClipboard::copyLinks(urls);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QTreeWidgetItem *ChatLobbyWidget::getTreeWidgetItem(ChatLobbyId id)
|
QTreeWidgetItem *ChatLobbyWidget::getTreeWidgetItem(ChatLobbyId id)
|
||||||
{
|
{
|
||||||
for(int p=0;p<4;++p)
|
for(int p=0;p<4;++p)
|
||||||
|
@ -50,7 +50,7 @@ public:
|
|||||||
|
|
||||||
void setCurrentChatPage(ChatLobbyDialog *) ; // used by ChatLobbyDialog to raise.
|
void setCurrentChatPage(ChatLobbyDialog *) ; // used by ChatLobbyDialog to raise.
|
||||||
void addChatPage(ChatLobbyDialog *) ;
|
void addChatPage(ChatLobbyDialog *) ;
|
||||||
void showLobbyAnchor(ChatLobbyId id, QString anchor) ;
|
bool showLobbyAnchor(ChatLobbyId id, QString anchor) ;
|
||||||
|
|
||||||
uint unreadCount();
|
uint unreadCount();
|
||||||
|
|
||||||
@ -78,6 +78,7 @@ protected slots:
|
|||||||
void updatePeerEntering(ChatLobbyId);
|
void updatePeerEntering(ChatLobbyId);
|
||||||
void updatePeerLeaving(ChatLobbyId);
|
void updatePeerLeaving(ChatLobbyId);
|
||||||
void autoSubscribeItem();
|
void autoSubscribeItem();
|
||||||
|
void copyItemLink();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void filterColumnChanged(int);
|
void filterColumnChanged(int);
|
||||||
|
@ -603,7 +603,7 @@ void SharedFilesDialog::copyLinks(const QModelIndexList& lst, bool remote,QList<
|
|||||||
|
|
||||||
QString dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
|
QString dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
|
||||||
|
|
||||||
RetroShareLink link = RetroShareLink::createCollection(dir_name,ft->mTotalSize,ft->mTotalFiles,QString::fromStdString(ft->toRadix64())) ;
|
RetroShareLink link = RetroShareLink::createFileTree(dir_name,ft->mTotalSize,ft->mTotalFiles,QString::fromStdString(ft->toRadix64())) ;
|
||||||
|
|
||||||
if(link.valid())
|
if(link.valid())
|
||||||
urls.push_back(link) ;
|
urls.push_back(link) ;
|
||||||
|
@ -1967,7 +1967,7 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
|
|||||||
case RS_SERVICE_GXS_TYPE_CHANNELS: service_name = tr("Channels") ;service_type = RetroShareLink::TYPE_CHANNEL ; break ;
|
case RS_SERVICE_GXS_TYPE_CHANNELS: service_name = tr("Channels") ;service_type = RetroShareLink::TYPE_CHANNEL ; break ;
|
||||||
case RS_SERVICE_GXS_TYPE_FORUMS: service_name = tr("Forums") ; service_type = RetroShareLink::TYPE_FORUM ; break ;
|
case RS_SERVICE_GXS_TYPE_FORUMS: service_name = tr("Forums") ; service_type = RetroShareLink::TYPE_FORUM ; break ;
|
||||||
case RS_SERVICE_GXS_TYPE_POSTED: service_name = tr("Posted") ; service_type = RetroShareLink::TYPE_POSTED ; break ;
|
case RS_SERVICE_GXS_TYPE_POSTED: service_name = tr("Posted") ; service_type = RetroShareLink::TYPE_POSTED ; break ;
|
||||||
case RS_SERVICE_TYPE_CHAT: service_name = tr("Chat") ; break ;
|
case RS_SERVICE_TYPE_CHAT: service_name = tr("Chat") ; service_type = RetroShareLink::TYPE_CHAT_ROOM ; break ;
|
||||||
default:
|
default:
|
||||||
service_name = tr("Unknown"); service_type = RetroShareLink::TYPE_UNKNOWN ;
|
service_name = tr("Unknown"); service_type = RetroShareLink::TYPE_UNKNOWN ;
|
||||||
}
|
}
|
||||||
@ -1994,8 +1994,8 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
|
|||||||
}
|
}
|
||||||
case RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION: // Chat lobby msgs are signed, so each time one comes, or a chat lobby event comes, a signature verificaiton happens.
|
case RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION: // Chat lobby msgs are signed, so each time one comes, or a chat lobby event comes, a signature verificaiton happens.
|
||||||
{
|
{
|
||||||
// there is no link for chat lobby yet.
|
RetroShareLink l = RetroShareLink::createChatRoom(ChatId(ChatLobbyId(u.mAdditionalId)),QString::number(u.mAdditionalId));
|
||||||
return tr("Message in chat lobby %1").arg(u.mAdditionalId) ;
|
return tr("Message in chat room %1").arg(l.toHtml()) ;
|
||||||
}
|
}
|
||||||
case RsIdentityUsage::GLOBAL_ROUTER_SIGNATURE_CHECK: // Global router message validation
|
case RsIdentityUsage::GLOBAL_ROUTER_SIGNATURE_CHECK: // Global router message validation
|
||||||
{
|
{
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -32,14 +32,16 @@
|
|||||||
// shared | Y | Y | Y (send RS link) | Paste menu? | Paste menu?
|
// shared | Y | Y | Y (send RS link) | Paste menu? | Paste menu?
|
||||||
// -------------+----------------+--------------------------+------------------+-------------+-------------
|
// -------------+----------------+--------------------------+------------------+-------------+-------------
|
||||||
//
|
//
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include <retroshare/rstypes.h>
|
|
||||||
#include <retroshare/rsgxsifacetypes.h>
|
#include <retroshare/rsgxsifacetypes.h>
|
||||||
|
#include <retroshare/rsmsgs.h>
|
||||||
|
#include <retroshare/rstypes.h>
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVector>
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#define RSLINK_PROCESS_NOTIFY_SUCCESS 1 // notify on success
|
#define RSLINK_PROCESS_NOTIFY_SUCCESS 1 // notify on success
|
||||||
#define RSLINK_PROCESS_NOTIFY_ERROR 2 // notify on error
|
#define RSLINK_PROCESS_NOTIFY_ERROR 2 // notify on error
|
||||||
@ -66,11 +68,12 @@ class RetroShareLink
|
|||||||
TYPE_MESSAGE = 0x06,
|
TYPE_MESSAGE = 0x06,
|
||||||
TYPE_CERTIFICATE = 0x07,
|
TYPE_CERTIFICATE = 0x07,
|
||||||
TYPE_EXTRAFILE = 0x08,
|
TYPE_EXTRAFILE = 0x08,
|
||||||
TYPE_PRIVATE_CHAT = 0x09,
|
TYPE_PRIVATE_CHAT = 0x09,//Deprecated
|
||||||
TYPE_PUBLIC_MSG = 0x0a,
|
TYPE_PUBLIC_MSG = 0x0a,
|
||||||
TYPE_POSTED = 0x0b,
|
TYPE_POSTED = 0x0b,
|
||||||
TYPE_IDENTITY = 0x0c,
|
TYPE_IDENTITY = 0x0c,
|
||||||
TYPE_FILE_TREE = 0x0d
|
TYPE_FILE_TREE = 0x0d,
|
||||||
|
TYPE_CHAT_ROOM = 0x0e
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -78,43 +81,47 @@ class RetroShareLink
|
|||||||
RetroShareLink(const QUrl& url);
|
RetroShareLink(const QUrl& url);
|
||||||
RetroShareLink(const QString& url);
|
RetroShareLink(const QString& url);
|
||||||
|
|
||||||
static RetroShareLink createIdentity(const RsGxsId& gxs_id,const QString& name,const QString& radix_data) ;
|
|
||||||
static RetroShareLink createExtraFile(const QString& name, uint64_t size, const QString& hash, const QString& ssl_id);
|
|
||||||
static RetroShareLink createFile(const QString& name, uint64_t size, const QString& hash);
|
static RetroShareLink createFile(const QString& name, uint64_t size, const QString& hash);
|
||||||
static RetroShareLink createCollection(const QString& name, uint64_t size,uint32_t count,const QString& radix_data);
|
|
||||||
static RetroShareLink createPublicMsgInvite(time_t time_stamp,const QString& pgp_id,const QString& hash) ;
|
|
||||||
static RetroShareLink createPerson(const RsPgpId &id);
|
static RetroShareLink createPerson(const RsPgpId &id);
|
||||||
static RetroShareLink createCertificate(const RsPeerId &ssl_id) ;
|
|
||||||
static RetroShareLink createUnknwonSslCertificate(const RsPeerId &sslId, const RsPgpId &gpgId = RsPgpId()) ;
|
|
||||||
static RetroShareLink createGxsGroupLink(const RetroShareLink::enumType &linkType, const RsGxsGroupId &groupId, const QString &groupName);
|
static RetroShareLink createGxsGroupLink(const RetroShareLink::enumType &linkType, const RsGxsGroupId &groupId, const QString &groupName);
|
||||||
static RetroShareLink createGxsMessageLink(const RetroShareLink::enumType &linkType, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &msgName);
|
static RetroShareLink createGxsMessageLink(const RetroShareLink::enumType &linkType, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &msgName);
|
||||||
static RetroShareLink createSearch(const QString& keywords);
|
static RetroShareLink createSearch(const QString& keywords);
|
||||||
static RetroShareLink createMessage(const RsPeerId &peerId, const QString& subject);
|
static RetroShareLink createMessage(const RsPeerId &peerId, const QString& subject);
|
||||||
static RetroShareLink createMessage(const RsGxsId &peerId, const QString& subject);
|
static RetroShareLink createMessage(const RsGxsId &peerId, const QString& subject);
|
||||||
|
static RetroShareLink createCertificate(const RsPeerId &ssl_id) ;
|
||||||
|
static RetroShareLink createUnknwonSslCertificate(const RsPeerId &sslId, const RsPgpId &gpgId = RsPgpId()) ;
|
||||||
|
static RetroShareLink createExtraFile(const QString& name, uint64_t size, const QString& hash, const QString& ssl_id);
|
||||||
|
static RetroShareLink createPublicMsgInvite(time_t time_stamp,const QString& pgp_id,const QString& hash) ;
|
||||||
|
static RetroShareLink createIdentity(const RsGxsId& gxs_id,const QString& name,const QString& radix_data) ;
|
||||||
|
static RetroShareLink createFileTree(const QString& name, uint64_t size,uint32_t count,const QString& radix_data);
|
||||||
|
static RetroShareLink createChatRoom(const ChatId &chatId, const QString& name);
|
||||||
|
|
||||||
|
bool valid() const { return _valid; }
|
||||||
enumType type() const {return _type; }
|
enumType type() const {return _type; }
|
||||||
uint64_t size() const { return _size ; }
|
|
||||||
const QString& name() const { return _name ; }
|
const QString& name() const { return _name ; }
|
||||||
|
uint64_t size() const { return _size ; }
|
||||||
const QString& hash() const { return _hash ; }
|
const QString& hash() const { return _hash ; }
|
||||||
const QString& id() const { return _hash ; }
|
const QString& id() const { return _hash ; }
|
||||||
const QString& msgId() const { return _msgId ; }
|
const QString& msgId() const { return _msgId ; }
|
||||||
const QString& subject() const { return _subject ; }
|
const QString& subject() const { return _subject ; }
|
||||||
const QString& GPGRadix64Key() const { return _GPGBase64String ; }
|
|
||||||
const QString& GPGBase64CheckSum() const { return _GPGBase64CheckSum ; }
|
|
||||||
const QString& SSLId() const { return _SSLid ; }
|
const QString& SSLId() const { return _SSLid ; }
|
||||||
const QString& GPGId() const { return _GPGid ; }
|
const QString& GPGId() const { return _GPGid ; }
|
||||||
const QString& localIPAndPort() const { return _loc_ip_port ; }
|
//const QString& GPGRadix64Key() const { return _GPGBase64String ; }
|
||||||
const QString& externalIPAndPort() const { return _ext_ip_port ; }
|
//const QString& GPGBase64CheckSum() const { return _GPGBase64CheckSum ; }
|
||||||
const QString& dyndns() const { return _dyndns_name ; }
|
|
||||||
const QString& location() const { return _location ; }
|
const QString& location() const { return _location ; }
|
||||||
|
//const QString& externalIPAndPort() const { return _ext_ip_port ; }
|
||||||
|
//const QString& localIPAndPort() const { return _loc_ip_port ; }
|
||||||
|
//const QString& dyndns() const { return _dyndns_name ; }
|
||||||
const QString& radix() const { return _radix ; }
|
const QString& radix() const { return _radix ; }
|
||||||
time_t timeStamp() const { return _time_stamp ; }
|
time_t timeStamp() const { return _time_stamp ; }
|
||||||
QString title() const;
|
|
||||||
QString radixGroupData() const { return _radix_group_data ;}
|
QString radixGroupData() const { return _radix_group_data ;}
|
||||||
|
uint32_t count() const { return _count ; }
|
||||||
|
|
||||||
unsigned int subType() const { return _subType; }
|
unsigned int subType() const { return _subType; }
|
||||||
void setSubType(unsigned int subType) { _subType = subType; }
|
void setSubType(unsigned int subType) { _subType = subType; }
|
||||||
|
|
||||||
|
// get title depends link's type
|
||||||
|
QString title() const;
|
||||||
// get nice name for anchor
|
// get nice name for anchor
|
||||||
QString niceName() const;
|
QString niceName() const;
|
||||||
|
|
||||||
@ -132,8 +139,6 @@ class RetroShareLink
|
|||||||
|
|
||||||
QUrl toUrl() const ;
|
QUrl toUrl() const ;
|
||||||
|
|
||||||
bool valid() const { return _valid; }
|
|
||||||
|
|
||||||
bool operator==(const RetroShareLink& l) const { return _type == l._type && _hash == l._hash ; }
|
bool operator==(const RetroShareLink& l) const { return _type == l._type && _hash == l._hash ; }
|
||||||
|
|
||||||
static int process(const QStringList &urls, RetroShareLink::enumType type = RetroShareLink::TYPE_UNKNOWN, uint flag = RSLINK_PROCESS_NOTIFY_ALL);
|
static int process(const QStringList &urls, RetroShareLink::enumType type = RetroShareLink::TYPE_UNKNOWN, uint flag = RSLINK_PROCESS_NOTIFY_ALL);
|
||||||
@ -154,19 +159,19 @@ class RetroShareLink
|
|||||||
enumType _type;
|
enumType _type;
|
||||||
QString _name;
|
QString _name;
|
||||||
uint64_t _size;
|
uint64_t _size;
|
||||||
QString _hash; // or id (forum, channel, message)
|
QString _hash; // or id (forum, channel, message, chat room)
|
||||||
QString _msgId; // id of the message (forum, channel)
|
QString _msgId; // id of the message (forum, channel)
|
||||||
QString _subject;
|
QString _subject;
|
||||||
QString _SSLid ; // ssl id for rs links
|
QString _SSLid ; // ssl id for rs links
|
||||||
QString _GPGid ; // ssl id for rs links
|
QString _GPGid ; // ssl id for rs links
|
||||||
QString _GPGBase64String ; // GPG Cert
|
//QString _GPGBase64String ; // GPG Cert
|
||||||
QString _GPGBase64CheckSum ; // GPG Cert
|
//QString _GPGBase64CheckSum ; // GPG Cert
|
||||||
QString _location ; // location
|
QString _location ; // location
|
||||||
QString _ext_ip_port ;
|
//QString _ext_ip_port ;
|
||||||
QString _loc_ip_port ;
|
//QString _loc_ip_port ;
|
||||||
QString _dyndns_name ;
|
//QString _dyndns_name ;
|
||||||
QString _radix ;
|
QString _radix ;
|
||||||
QString _encrypted_chat_info ; // encrypted data string for the recipient of a chat invite
|
//QString _encrypted_chat_info ; // encrypted data string for the recipient of a chat invite
|
||||||
time_t _time_stamp ; // time stamp at which the link will expire.
|
time_t _time_stamp ; // time stamp at which the link will expire.
|
||||||
QString _radix_group_data;
|
QString _radix_group_data;
|
||||||
uint32_t _count ;
|
uint32_t _count ;
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include <retroshare/rsnotify.h>
|
#include <retroshare/rsnotify.h>
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
|
|
||||||
static std::map<ChatId, ChatDialog*> chatDialogs2;
|
static std::map<ChatId, ChatDialog*> chatDialogsList;
|
||||||
|
|
||||||
ChatDialog::ChatDialog(QWidget *parent, Qt::WindowFlags flags) :
|
ChatDialog::ChatDialog(QWidget *parent, Qt::WindowFlags flags) :
|
||||||
QWidget(parent, flags)
|
QWidget(parent, flags)
|
||||||
@ -49,8 +49,8 @@ ChatDialog::ChatDialog(QWidget *parent, Qt::WindowFlags flags) :
|
|||||||
ChatDialog::~ChatDialog()
|
ChatDialog::~ChatDialog()
|
||||||
{
|
{
|
||||||
std::map<ChatId, ChatDialog *>::iterator it;
|
std::map<ChatId, ChatDialog *>::iterator it;
|
||||||
if (chatDialogs2.end() != (it = chatDialogs2.find(mChatId))) {
|
if (chatDialogsList.end() != (it = chatDialogsList.find(mChatId))) {
|
||||||
chatDialogs2.erase(it);
|
chatDialogsList.erase(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ void ChatDialog::init(const ChatId &id, const QString &title)
|
|||||||
/*static*/ ChatDialog* ChatDialog::getExistingChat(ChatId id)
|
/*static*/ ChatDialog* ChatDialog::getExistingChat(ChatId id)
|
||||||
{
|
{
|
||||||
std::map<ChatId, ChatDialog*>::iterator it;
|
std::map<ChatId, ChatDialog*>::iterator it;
|
||||||
if (chatDialogs2.end() != (it = chatDialogs2.find(id))) {
|
if (chatDialogsList.end() != (it = chatDialogsList.find(id))) {
|
||||||
/* exists already */
|
/* exists already */
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ void ChatDialog::init(const ChatId &id, const QString &title)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cd)
|
if(cd)
|
||||||
chatDialogs2[id] = cd;
|
chatDialogsList[id] = cd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,13 +143,13 @@ void ChatDialog::init(const ChatId &id, const QString &title)
|
|||||||
std::list<ChatDialog*> list;
|
std::list<ChatDialog*> list;
|
||||||
|
|
||||||
std::map<ChatId, ChatDialog*>::iterator it;
|
std::map<ChatId, ChatDialog*>::iterator it;
|
||||||
for (it = chatDialogs2.begin(); it != chatDialogs2.end(); ++it) {
|
for (it = chatDialogsList.begin(); it != chatDialogsList.end(); ++it) {
|
||||||
if (it->second) {
|
if (it->second) {
|
||||||
list.push_back(it->second);
|
list.push_back(it->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chatDialogs2.clear();
|
chatDialogsList.clear();
|
||||||
|
|
||||||
std::list<ChatDialog*>::iterator it1;
|
std::list<ChatDialog*>::iterator it1;
|
||||||
for (it1 = list.begin(); it1 != list.end(); ++it1) {
|
for (it1 = list.begin(); it1 != list.end(); ++it1) {
|
||||||
|
@ -172,7 +172,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
|||||||
|
|
||||||
connect(ui->textBrowser, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint)));
|
connect(ui->textBrowser, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint)));
|
||||||
|
|
||||||
connect(ui->chatTextEdit, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint)));
|
//connect(ui->chatTextEdit, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint)));
|
||||||
// reset text and color after removing all characters from the QTextEdit and after calling QTextEdit::clear
|
// reset text and color after removing all characters from the QTextEdit and after calling QTextEdit::clear
|
||||||
connect(ui->chatTextEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SLOT(chatCharFormatChanged()));
|
connect(ui->chatTextEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SLOT(chatCharFormatChanged()));
|
||||||
connect(ui->chatTextEdit, SIGNAL(textChanged()), this, SLOT(updateLenOfChatTextEdit()));
|
connect(ui->chatTextEdit, SIGNAL(textChanged()), this, SLOT(updateLenOfChatTextEdit()));
|
||||||
|
@ -229,7 +229,6 @@ bool RsHtml::canReplaceAnchor(QDomDocument &/*doc*/, QDomElement &/*element*/, c
|
|||||||
switch (link.type()) {
|
switch (link.type()) {
|
||||||
case RetroShareLink::TYPE_UNKNOWN:
|
case RetroShareLink::TYPE_UNKNOWN:
|
||||||
case RetroShareLink::TYPE_FILE:
|
case RetroShareLink::TYPE_FILE:
|
||||||
case RetroShareLink::TYPE_FILE_TREE:
|
|
||||||
case RetroShareLink::TYPE_PERSON:
|
case RetroShareLink::TYPE_PERSON:
|
||||||
case RetroShareLink::TYPE_FORUM:
|
case RetroShareLink::TYPE_FORUM:
|
||||||
case RetroShareLink::TYPE_CHANNEL:
|
case RetroShareLink::TYPE_CHANNEL:
|
||||||
@ -240,6 +239,8 @@ bool RsHtml::canReplaceAnchor(QDomDocument &/*doc*/, QDomElement &/*element*/, c
|
|||||||
case RetroShareLink::TYPE_PUBLIC_MSG:
|
case RetroShareLink::TYPE_PUBLIC_MSG:
|
||||||
case RetroShareLink::TYPE_POSTED:
|
case RetroShareLink::TYPE_POSTED:
|
||||||
case RetroShareLink::TYPE_IDENTITY:
|
case RetroShareLink::TYPE_IDENTITY:
|
||||||
|
case RetroShareLink::TYPE_FILE_TREE:
|
||||||
|
case RetroShareLink::TYPE_CHAT_ROOM:
|
||||||
// not yet implemented
|
// not yet implemented
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -260,7 +261,6 @@ void RsHtml::anchorStylesheetForImg(QDomDocument &/*doc*/, QDomElement &/*elemen
|
|||||||
switch (link.type()) {
|
switch (link.type()) {
|
||||||
case RetroShareLink::TYPE_UNKNOWN:
|
case RetroShareLink::TYPE_UNKNOWN:
|
||||||
case RetroShareLink::TYPE_FILE:
|
case RetroShareLink::TYPE_FILE:
|
||||||
case RetroShareLink::TYPE_FILE_TREE:
|
|
||||||
case RetroShareLink::TYPE_PERSON:
|
case RetroShareLink::TYPE_PERSON:
|
||||||
case RetroShareLink::TYPE_FORUM:
|
case RetroShareLink::TYPE_FORUM:
|
||||||
case RetroShareLink::TYPE_CHANNEL:
|
case RetroShareLink::TYPE_CHANNEL:
|
||||||
@ -271,6 +271,8 @@ void RsHtml::anchorStylesheetForImg(QDomDocument &/*doc*/, QDomElement &/*elemen
|
|||||||
case RetroShareLink::TYPE_PUBLIC_MSG:
|
case RetroShareLink::TYPE_PUBLIC_MSG:
|
||||||
case RetroShareLink::TYPE_POSTED:
|
case RetroShareLink::TYPE_POSTED:
|
||||||
case RetroShareLink::TYPE_IDENTITY:
|
case RetroShareLink::TYPE_IDENTITY:
|
||||||
|
case RetroShareLink::TYPE_FILE_TREE:
|
||||||
|
case RetroShareLink::TYPE_CHAT_ROOM:
|
||||||
// not yet implemented
|
// not yet implemented
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user