Merge branch 'master' into webui

This commit is contained in:
electron128 2016-02-14 13:24:33 +01:00
commit 85149df1ef
9 changed files with 18 additions and 53 deletions

View File

@ -768,7 +768,7 @@ void DistributedChatService::handleRecvChatLobbyEventItem(RsChatLobbyEventItem *
#endif
}
}
RsServer::notify()->notifyChatLobbyEvent(item->lobby_id,item->event_type,item->signature.keyId.toStdString(),item->string1) ;
RsServer::notify()->notifyChatLobbyEvent(item->lobby_id,item->event_type,item->signature.keyId,item->string1) ;
}
void DistributedChatService::getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& visible_lobbies)
{
@ -1834,7 +1834,7 @@ void DistributedChatService::cleanLobbyCaches()
// update the gui
for(std::list<ChatLobbyId>::const_iterator it(changed_lobbies.begin());it!=changed_lobbies.end();++it)
RsServer::notify()->notifyChatLobbyEvent(*it,RS_CHAT_LOBBY_EVENT_KEEP_ALIVE,"","") ;
RsServer::notify()->notifyChatLobbyEvent(*it,RS_CHAT_LOBBY_EVENT_KEEP_ALIVE,RsGxsId(),"") ;
// send connection challenges
//

View File

@ -217,7 +217,7 @@ bool p3Notify::ClearFeedItems(uint32_t type)
#define FOR_ALL_NOTIFY_CLIENTS for(std::list<NotifyClient*>::const_iterator it(notifyClients.begin());it!=notifyClients.end();++it)
void p3Notify::notifyChatLobbyEvent(uint64_t lobby_id, uint32_t event_type,const std::string& nickname,const std::string& any_string) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyChatLobbyEvent(lobby_id,event_type,nickname,any_string) ; }
void p3Notify::notifyChatLobbyEvent(uint64_t lobby_id, uint32_t event_type,const RsGxsId& nickname,const std::string& any_string) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyChatLobbyEvent(lobby_id,event_type,nickname,any_string) ; }
void p3Notify::notifyListPreChange(int list, int type) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyListPreChange(list,type) ; }
void p3Notify::notifyListChange (int list, int type) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyListChange (list,type) ; }
@ -239,10 +239,7 @@ void p3Notify::notifyGxsChange (const RsGxsChanges& changes) {FOR_A
void p3Notify::notifyPeerStatusChangedSummary () { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyPeerStatusChangedSummary() ; }
void p3Notify::notifyDiscInfoChanged () { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyDiscInfoChanged () ; }
#ifdef REMOVE
void p3Notify::notifyForumMsgReadSatusChanged (const std::string& channelId, const std::string& msgId, uint32_t status) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyForumMsgReadSatusChanged (channelId,msgId,status) ; }
void p3Notify::notifyChannelMsgReadSatusChanged (const std::string& channelId, const std::string& msgId, uint32_t status) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyChannelMsgReadSatusChanged (channelId,msgId,status) ; }
#endif
void p3Notify::notifyDownloadComplete (const std::string& fileHash ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyDownloadComplete (fileHash) ; }
void p3Notify::notifyDownloadCompleteCount (uint32_t count ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyDownloadCompleteCount (count) ; }
void p3Notify::notifyHistoryChanged (uint32_t msgId , int type) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyHistoryChanged (msgId,type) ; }

View File

@ -100,7 +100,7 @@ class p3Notify: public RsNotify
void notifyErrorMsg (int /* list */, int /* sev */, std::string /* msg */) ;
void notifyChatMessage (const ChatMessage& /* msg */) ;
void notifyChatStatus (const ChatId& /* chat_id */, const std::string& /* status_string */) ;
void notifyChatLobbyEvent (uint64_t /* lobby id */, uint32_t /* event type */ ,const std::string& /* nickname */,const std::string& /* any string */) ;
void notifyChatLobbyEvent (uint64_t /* lobby id */, uint32_t /* event type */ , const RsGxsId & /* nickname */, const std::string& /* any string */) ;
void notifyChatLobbyTimeShift (int /* time_shift*/) ;
void notifyCustomState (const std::string& /* peer_id */, const std::string& /* status_string */) ;
void notifyHashingInfo (uint32_t /* type */, const std::string& /* fileinfo */) ;
@ -114,10 +114,7 @@ class p3Notify: public RsNotify
void notifyPeerStatusChangedSummary () ;
void notifyDiscInfoChanged () ;
#ifdef REMOVE
void notifyForumMsgReadSatusChanged (const std::string& /* channelId */, const std::string& /* msgId */, uint32_t /* status */) ;
void notifyChannelMsgReadSatusChanged (const std::string& /* channelId */, const std::string& /* msgId */, uint32_t /* status */) ;
#endif
bool askForDeferredSelfSignature (const void * /* data */, const uint32_t /* len */, unsigned char * /* sign */, unsigned int * /* signlen */,int& signature_result ) ;
void notifyDownloadComplete (const std::string& /* fileHash */) ;
void notifyDownloadCompleteCount (uint32_t /* count */) ;

View File

@ -212,7 +212,7 @@ class NotifyClient
virtual void notifyErrorMsg (int /* list */, int /* sev */, std::string /* msg */) {}
virtual void notifyChatMessage (const ChatMessage& /* msg */) {}
virtual void notifyChatStatus (const ChatId& /* chat_id */, const std::string& /* status_string */) {}
virtual void notifyChatLobbyEvent (uint64_t /* lobby id */, uint32_t /* event type */ ,const std::string& /* nickname */,const std::string& /* any string */) {}
virtual void notifyChatLobbyEvent (uint64_t /* lobby id */, uint32_t /* event type */ ,const RsGxsId& /* nickname */,const std::string& /* any string */) {}
virtual void notifyChatLobbyTimeShift (int /* time_shift*/) {}
virtual void notifyCustomState (const std::string& /* peer_id */, const std::string& /* status_string */) {}
virtual void notifyHashingInfo (uint32_t /* type */, const std::string& /* fileinfo */) {}
@ -227,10 +227,7 @@ class NotifyClient
/* one or more peers has changed the states */
virtual void notifyPeerStatusChangedSummary () {}
virtual void notifyDiscInfoChanged () {}
#ifdef REMOVE
virtual void notifyForumMsgReadSatusChanged (const std::string& /* channelId */, const std::string& /* msgId */, uint32_t /* status */) {}
virtual void notifyChannelMsgReadSatusChanged (const std::string& /* channelId */, const std::string& /* msgId */, uint32_t /* status */) {}
#endif
virtual bool askForDeferredSelfSignature (const void * /* data */, const uint32_t /* len */, unsigned char * /* sign */, unsigned int * /* signlen */,int& signature_result ) { signature_result = false ;return true; }
virtual void notifyDownloadComplete (const std::string& /* fileHash */) {}
virtual void notifyDownloadCompleteCount (uint32_t /* count */) {}

View File

@ -62,7 +62,7 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
myChatLobbyUserNotify = NULL;
QObject::connect( NotifyQt::getInstance(), SIGNAL(lobbyListChanged()), SLOT(lobbyChanged()));
QObject::connect( NotifyQt::getInstance(), SIGNAL(chatLobbyEvent(qulonglong,int,const QString&,const QString&)), this, SLOT(displayChatLobbyEvent(qulonglong,int,const QString&,const QString&)));
QObject::connect( NotifyQt::getInstance(), SIGNAL(chatLobbyEvent(qulonglong,int,const RsGxsId&,const QString&)), this, SLOT(displayChatLobbyEvent(qulonglong,int,const RsGxsId&,const QString&)));
QObject::connect( NotifyQt::getInstance(), SIGNAL(chatLobbyInviteReceived()), this, SLOT(readChatLobbyInvites()));
QObject::connect( ui.lobbyTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(lobbyTreeWidgetCustomPopupMenu(QPoint)));
@ -1054,10 +1054,10 @@ void ChatLobbyWidget::itemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
subscribeChatLobbyAtItem(item);
}
void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const QString& gxs_id, const QString& str)
void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const RsGxsId &gxs_id, const QString& str)
{
if (ChatLobbyDialog *cld = dynamic_cast<ChatLobbyDialog*>(ChatDialog::getExistingChat(ChatId(lobby_id)))) {
cld->displayLobbyEvent(event_type, RsGxsId(gxs_id.toStdString()), str);
cld->displayLobbyEvent(event_type, gxs_id, str);
}
}

View File

@ -59,7 +59,7 @@ protected slots:
void unsubscribeItem();
void itemDoubleClicked(QTreeWidgetItem *item, int column);
void updateCurrentLobby() ;
void displayChatLobbyEvent(qulonglong lobby_id, int event_type, const QString& gxs_id, const QString& str);
void displayChatLobbyEvent(qulonglong lobby_id, int event_type, const RsGxsId& gxs_id, const QString& str);
void readChatLobbyInvites();
void showLobby(QTreeWidgetItem *lobby_item) ;
void showBlankPage(ChatLobbyId id) ;

View File

@ -73,7 +73,7 @@ void Emoticons::load()
int i = 0;
QString smcode;
QString smfile;
while(sm_codes[i] != '{')
while(i < sm_codes.length() && sm_codes[i] != '{')
{
++i;
}

View File

@ -104,6 +104,7 @@ NotifyQt::NotifyQt() : cDialog(NULL)
qRegisterMetaType<ChatId>("ChatId");
qRegisterMetaType<ChatMessage>("ChatMessage");
qRegisterMetaType<RsGxsChanges>("RsGxsChanges");
qRegisterMetaType<RsGxsId>("RsGxsId");
}
void NotifyQt::notifyErrorMsg(int list, int type, std::string msg)
@ -420,29 +421,6 @@ void NotifyQt::notifyGxsChange(const RsGxsChanges& changes)
emit gxsChange(changes);
}
#ifdef REMOVE
void NotifyQt::notifyForumMsgReadSatusChanged(const std::string& forumId, const std::string& msgId, uint32_t status)
{
{
QMutexLocker m(&_mutex) ;
if(!_enabled)
return ;
}
emit forumMsgReadSatusChanged(QString::fromStdString(forumId), QString::fromStdString(msgId), status);
}
void NotifyQt::notifyChannelMsgReadSatusChanged(const std::string& channelId, const std::string& msgId, uint32_t status)
{
{
QMutexLocker m(&_mutex) ;
if(!_enabled)
return ;
}
emit channelMsgReadSatusChanged(QString::fromStdString(channelId), QString::fromStdString(msgId), status);
}
#endif
void NotifyQt::notifyOwnStatusMessageChanged()
{
{
@ -513,7 +491,7 @@ void NotifyQt::handleChatLobbyTimeShift(int /*shift*/)
}
}
void NotifyQt::notifyChatLobbyEvent(uint64_t lobby_id,uint32_t event_type,const std::string& nickname,const std::string& str)
void NotifyQt::notifyChatLobbyEvent(uint64_t lobby_id,uint32_t event_type,const RsGxsId& nickname,const std::string& str)
{
{
QMutexLocker m(&_mutex) ;
@ -524,7 +502,7 @@ void NotifyQt::notifyChatLobbyEvent(uint64_t lobby_id,uint32_t event_type,const
#ifdef NOTIFY_DEBUG
std::cerr << "notifyQt: Received chat lobby event message: lobby #" << std::hex << lobby_id << std::dec << ", event=" << event_type << ", str=\"" << str << "\"" << std::endl ;
#endif
emit chatLobbyEvent(lobby_id,event_type,QString::fromUtf8(nickname.c_str()),QString::fromUtf8(str.c_str())) ;
emit chatLobbyEvent(lobby_id,event_type,nickname,QString::fromUtf8(str.c_str())) ;
}
void NotifyQt::notifyChatStatus(const ChatId& chat_id,const std::string& status_string)

View File

@ -49,7 +49,7 @@ class NotifyQt: public QObject, public NotifyClient
virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& found_files);
virtual void notifyPeerHasNewAvatar(std::string peer_id) ;
virtual void notifyOwnAvatarChanged() ;
virtual void notifyChatLobbyEvent(uint64_t /* lobby id */,uint32_t /* event type */,const std::string& /*nickname*/,const std::string& /* any string */) ;
virtual void notifyChatLobbyEvent(uint64_t /* lobby id */, uint32_t /* event type */, const RsGxsId & /*nickname*/, const std::string& /* any string */) ;
virtual void notifyChatLobbyTimeShift(int time_shift) ;
virtual void notifyOwnStatusMessageChanged() ;
@ -61,10 +61,6 @@ class NotifyQt: public QObject, public NotifyClient
virtual void notifyGxsChange(const RsGxsChanges& change);
#ifdef REMOVE
virtual void notifyForumMsgReadSatusChanged(const std::string& forumId, const std::string& msgId, uint32_t status);
virtual void notifyChannelMsgReadSatusChanged(const std::string& channelId, const std::string& msgId, uint32_t status);
#endif
virtual void notifyHistoryChanged(uint32_t msgId, int type);
virtual void notifyDiscInfoChanged() ;
@ -107,7 +103,7 @@ class NotifyQt: public QObject, public NotifyClient
void transfersChanged() const ;
void friendsChanged() const ;
void lobbyListChanged() const ;
void chatLobbyEvent(qulonglong,int,const QString&,const QString&) ;
void chatLobbyEvent(qulonglong,int,const RsGxsId&,const QString&) ;
void neighboursChanged() const ;
void messagesChanged() const ;
void messagesTagsChanged() const;