mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-14 17:39:37 -04:00
Updated the notification system. Main changes are:
- the notification system is now a service, p3Notify, that is a public RsNotify. - RsNotify does nothing except providing a registration system for new notify clients. - Clients should derive a notify client from the NotifyClient class and register it to rsNotify - all registered clients get all notifications, so only derive the needed methods. This should allow plugins to get notifications as well. - updated the code to call RsServer::notify()->[notification method] from inside libretroshare - pqiNotify has been removed. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6996 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3cc8c144a8
commit
630824aa1b
47 changed files with 482 additions and 484 deletions
|
@ -30,7 +30,8 @@
|
|||
#ifdef WINDOWS_SYS
|
||||
#include "retroshare/rsinit.h"
|
||||
#endif
|
||||
#include "pqi/pqinotify.h"
|
||||
#include "rsserver/p3face.h"
|
||||
#include "pqi/p3notify.h"
|
||||
#include "pgp/pgphandler.h"
|
||||
|
||||
#include <util/rsdir.h>
|
||||
|
@ -92,7 +93,7 @@ std::string pgp_pwd_callback(void * /*hook*/, const char *uid_hint, const char *
|
|||
fprintf(stderr, "pgp_pwd_callback() called.\n");
|
||||
#endif
|
||||
std::string password;
|
||||
rsicontrol->getNotify().askForPassword(std::string("Please enter your PGP password for key:\n ")+uid_hint+" :", prev_was_bad, password) ;
|
||||
RsServer::notify()->askForPassword(std::string("Please enter your PGP password for key:\n ")+uid_hint+" :", prev_was_bad, password) ;
|
||||
|
||||
return password ;
|
||||
}
|
||||
|
@ -621,7 +622,7 @@ bool AuthGPG::AllowConnection(const std::string &gpg_id, bool accept)
|
|||
|
||||
IndicateConfigChanged();
|
||||
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_FRIENDS, accept ? NOTIFY_TYPE_ADD : NOTIFY_TYPE_DEL);
|
||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_FRIENDS, accept ? NOTIFY_TYPE_ADD : NOTIFY_TYPE_DEL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -42,13 +42,11 @@
|
|||
#include "util/rsstring.h"
|
||||
|
||||
#include "retroshare/rspeers.h" // for RsPeerDetails structure
|
||||
#include "rsserver/p3face.h"
|
||||
|
||||
/******************** notify of new Cert **************************/
|
||||
#include "pqinotify.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
//#include <openssl/evp.h>
|
||||
//#include <openssl/pem.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
|
@ -1395,8 +1393,8 @@ bool AuthSSLimpl::FailedCertificate(X509 *x509, const std::string& gpgid,
|
|||
#endif
|
||||
if (incoming)
|
||||
{
|
||||
getPqiNotify()->AddPopupMessage(RS_POPUP_CONNECT_ATTEMPT, gpgid, sslcn, sslid);
|
||||
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_SEC_CONNECT_ATTEMPT, gpgid, sslid, sslcn, ip_address);
|
||||
RsServer::notify()->AddPopupMessage(RS_POPUP_CONNECT_ATTEMPT, gpgid, sslcn, sslid);
|
||||
RsServer::notify()->AddFeedItem(RS_FEED_ITEM_SEC_CONNECT_ATTEMPT, gpgid, sslid, sslcn, ip_address);
|
||||
|
||||
#ifdef AUTHSSL_DEBUG
|
||||
std::cerr << " Incoming from: ";
|
||||
|
@ -1405,9 +1403,9 @@ bool AuthSSLimpl::FailedCertificate(X509 *x509, const std::string& gpgid,
|
|||
else
|
||||
{
|
||||
if(authed)
|
||||
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_SEC_AUTH_DENIED, gpgid, sslid, sslcn, ip_address);
|
||||
RsServer::notify()->AddFeedItem(RS_FEED_ITEM_SEC_AUTH_DENIED, gpgid, sslid, sslcn, ip_address);
|
||||
else
|
||||
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_SEC_UNKNOWN_OUT, gpgid, sslid, sslcn, ip_address);
|
||||
RsServer::notify()->AddFeedItem(RS_FEED_ITEM_SEC_UNKNOWN_OUT, gpgid, sslid, sslcn, ip_address);
|
||||
|
||||
#ifdef AUTHSSL_DEBUG
|
||||
std::cerr << " Outgoing to: ";
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
#include "pqi/pqibin.h"
|
||||
#include "pqi/pqistore.h"
|
||||
#include "pqi/pqiarchive.h"
|
||||
#include "pqi/pqinotify.h"
|
||||
#include <errno.h>
|
||||
#include <rsserver/p3face.h>
|
||||
#include <util/rsdiscspace.h>
|
||||
#include "util/rsstring.h"
|
||||
|
||||
|
@ -335,10 +335,10 @@ bool p3ConfigMgr::backedUpFileSave(const std::string& fname, const std::string&
|
|||
}
|
||||
|
||||
if(size_file != (int) fwrite(config_buff,1, size_file, file))
|
||||
getPqiNotify()->AddSysMessage(0, RS_SYS_WARNING, "Write error", "Error while writing backup configuration file " + fname_backup + "\nIs your disc full or out of quota ?");
|
||||
RsServer::notify()->AddSysMessage(0, RS_SYS_WARNING, "Write error", "Error while writing backup configuration file " + fname_backup + "\nIs your disc full or out of quota ?");
|
||||
|
||||
if(size_sign != (int) fwrite(sign_buff, 1, size_sign, sign))
|
||||
getPqiNotify()->AddSysMessage(0, RS_SYS_WARNING, "Write error", "Error while writing main signature file " + sign_fname_backup + "\nIs your disc full or out of quota ?");
|
||||
RsServer::notify()->AddSysMessage(0, RS_SYS_WARNING, "Write error", "Error while writing main signature file " + sign_fname_backup + "\nIs your disc full or out of quota ?");
|
||||
|
||||
fclose(file);
|
||||
fclose(sign);
|
||||
|
@ -1146,7 +1146,7 @@ bool p3Config::backedUpFileSave(const std::string& cfg_fname, const std::string&
|
|||
|
||||
if(size_file != (int) fwrite(buff, 1, size_file, cfg_file))
|
||||
{
|
||||
getPqiNotify()->AddSysMessage(0, RS_SYS_WARNING, "Write error", "Error while writing backup configuration file " + cfg_fname_backup + "\nIs your disc full or out of quota ?");
|
||||
RsServer::notify()->AddSysMessage(0, RS_SYS_WARNING, "Write error", "Error while writing backup configuration file " + cfg_fname_backup + "\nIs your disc full or out of quota ?");
|
||||
fclose(cfg_file);
|
||||
delete[] buff;
|
||||
return false ;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "retroshare/rsiface.h"
|
||||
#include "retroshare/rspeers.h"
|
||||
#include "serialiser/rsmsgitems.h"
|
||||
#include "rsserver/p3face.h"
|
||||
#include "util/rsstring.h"
|
||||
|
||||
// clean too old messages every 5 minutes
|
||||
|
@ -145,7 +146,7 @@ void p3HistoryMgr::addMessage(bool incoming, const std::string &chatPeerId, cons
|
|||
}
|
||||
|
||||
if (addMsgId) {
|
||||
rsicontrol->getNotify().notifyHistoryChanged(addMsgId, NOTIFY_TYPE_ADD);
|
||||
RsServer::notify()->notifyHistoryChanged(addMsgId, NOTIFY_TYPE_ADD);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -450,7 +451,7 @@ void p3HistoryMgr::clear(const std::string &chatPeerId)
|
|||
IndicateConfigChanged();
|
||||
}
|
||||
|
||||
rsicontrol->getNotify().notifyHistoryChanged(0, NOTIFY_TYPE_MOD);
|
||||
RsServer::notify()->notifyHistoryChanged(0, NOTIFY_TYPE_MOD);
|
||||
}
|
||||
|
||||
void p3HistoryMgr::removeMessages(const std::list<uint32_t> &msgIds)
|
||||
|
@ -492,7 +493,7 @@ void p3HistoryMgr::removeMessages(const std::list<uint32_t> &msgIds)
|
|||
IndicateConfigChanged();
|
||||
|
||||
for (iit = removedIds.begin(); iit != removedIds.end(); ++iit) {
|
||||
rsicontrol->getNotify().notifyHistoryChanged(*iit, NOTIFY_TYPE_DEL);
|
||||
RsServer::notify()->notifyHistoryChanged(*iit, NOTIFY_TYPE_DEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "pqi/p3peermgr.h"
|
||||
#include "pqi/p3netmgr.h"
|
||||
|
||||
#include "rsserver/p3face.h"
|
||||
#include "pqi/authssl.h"
|
||||
#include "pqi/p3dhtmgr.h" // Only need it for constants.
|
||||
#include "tcponudp/tou.h"
|
||||
|
@ -43,7 +44,6 @@
|
|||
const int p3connectzone = 3431;
|
||||
|
||||
#include "serialiser/rsconfigitems.h"
|
||||
#include "pqi/pqinotify.h"
|
||||
|
||||
#include "retroshare/rsiface.h"
|
||||
#include "retroshare/rspeers.h"
|
||||
|
@ -478,7 +478,7 @@ void p3LinkMgrIMPL::tickMonitors()
|
|||
/* notify GUI */
|
||||
if (peer.actions & RS_PEER_CONNECTED)
|
||||
{
|
||||
pqiNotify *notify = getPqiNotify();
|
||||
p3Notify *notify = RsServer::notify();
|
||||
if (notify)
|
||||
{
|
||||
notify->AddPopupMessage(RS_POPUP_CONNECT, peer.id,"", "Online: ");
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
const int p3netmgrzone = 7563;
|
||||
|
||||
#include "serialiser/rsconfigitems.h"
|
||||
#include "pqi/pqinotify.h"
|
||||
#include "retroshare/rsiface.h"
|
||||
#include "retroshare/rsconfig.h"
|
||||
|
||||
|
|
|
@ -27,15 +27,9 @@
|
|||
#include "pqi/p3notify.h"
|
||||
#include <stdint.h>
|
||||
|
||||
/* external reference point */
|
||||
RsNotify *rsNotify = NULL;
|
||||
RsNotify *rsNotify = NULL ;
|
||||
|
||||
pqiNotify *getPqiNotify()
|
||||
{
|
||||
return ((p3Notify *) rsNotify);
|
||||
}
|
||||
|
||||
/* Output for retroshare-gui */
|
||||
/* Output for retroshare-gui */
|
||||
bool p3Notify::NotifySysMessage(uint32_t &sysid, uint32_t &type,
|
||||
std::string &title, std::string &msg)
|
||||
{
|
||||
|
@ -228,3 +222,64 @@ bool p3Notify::ClearFeedItems(uint32_t type)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#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::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) ; }
|
||||
|
||||
void p3Notify::notifyErrorMsg (int list, int sev, std::string msg) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyErrorMsg(list,sev,msg) ; }
|
||||
void p3Notify::notifyChatStatus (const std::string& peer_id , const std::string& status_string ,bool is_private) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyChatStatus(peer_id,status_string,is_private) ; }
|
||||
|
||||
void p3Notify::notifyChatLobbyTimeShift (int time_shift) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyChatLobbyTimeShift(time_shift) ; }
|
||||
void p3Notify::notifyCustomState (const std::string& peer_id , const std::string& status_string ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyCustomState (peer_id,status_string) ; }
|
||||
void p3Notify::notifyHashingInfo (uint32_t type , const std::string& fileinfo ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyHashingInfo (type,fileinfo) ; }
|
||||
void p3Notify::notifyTurtleSearchResult (uint32_t search_id , const std::list<TurtleFileInfo>& files ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyTurtleSearchResult(search_id,files) ; }
|
||||
void p3Notify::notifyPeerHasNewAvatar (std::string peer_id ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyPeerHasNewAvatar(peer_id) ; }
|
||||
void p3Notify::notifyOwnAvatarChanged () { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyOwnAvatarChanged() ; }
|
||||
void p3Notify::notifyOwnStatusMessageChanged() { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyOwnStatusMessageChanged() ; }
|
||||
void p3Notify::notifyDiskFull (uint32_t location , uint32_t size_limit_in_MB ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyDiskFull (location,size_limit_in_MB) ; }
|
||||
void p3Notify::notifyPeerStatusChanged (const std::string& peer_id , uint32_t status ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyPeerStatusChanged (peer_id,status) ; }
|
||||
|
||||
void p3Notify::notifyPeerStatusChangedSummary () { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyPeerStatusChangedSummary() ; }
|
||||
void p3Notify::notifyDiscInfoChanged () { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyDiscInfoChanged () ; }
|
||||
|
||||
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) ; }
|
||||
|
||||
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) ; }
|
||||
|
||||
bool p3Notify::askForPassword (const std::string& key_details , bool prev_is_bad , std::string& password)
|
||||
{
|
||||
FOR_ALL_NOTIFY_CLIENTS
|
||||
if( (*it)->askForPassword(key_details,prev_is_bad,password))
|
||||
return true ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
bool p3Notify::askForPluginConfirmation (const std::string& plugin_filename, const std::string& plugin_file_hash)
|
||||
{
|
||||
FOR_ALL_NOTIFY_CLIENTS
|
||||
if( (*it)->askForPluginConfirmation(plugin_filename,plugin_file_hash))
|
||||
return true ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
bool p3Notify::askForDeferredSelfSignature (const void * data , const uint32_t len , unsigned char *sign, unsigned int *signlen,int& signature_result )
|
||||
{
|
||||
FOR_ALL_NOTIFY_CLIENTS
|
||||
if( (*it)->askForDeferredSelfSignature(data,len,sign,signlen,signature_result))
|
||||
return true ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
void p3Notify::registerNotifyClient(NotifyClient *cl)
|
||||
{
|
||||
notifyClients.push_back(cl) ;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
#include "retroshare/rsnotify.h"
|
||||
#include "pqi/pqinotify.h"
|
||||
#include "retroshare/rsturtle.h"
|
||||
|
||||
#include "util/rsthreads.h"
|
||||
|
||||
|
@ -62,43 +62,76 @@ class p3NotifyPopupMsg
|
|||
};
|
||||
|
||||
|
||||
class p3Notify: public RsNotify, public pqiNotify
|
||||
class p3Notify: public RsNotify
|
||||
{
|
||||
public:
|
||||
|
||||
p3Notify() : noteMtx("p3Notify") { return; }
|
||||
virtual ~p3Notify() { return; }
|
||||
p3Notify() : noteMtx("p3Notify") { return; }
|
||||
virtual ~p3Notify() { return; }
|
||||
|
||||
/* Output for retroshare-gui */
|
||||
virtual bool NotifySysMessage(uint32_t &sysid, uint32_t &type, std::string &title, std::string &msg);
|
||||
virtual bool NotifyPopupMessage(uint32_t &ptype, std::string &name, std::string &title, std::string &msg);
|
||||
virtual bool NotifyLogMessage(uint32_t &sysid, uint32_t &type, std::string &title, std::string &msg);
|
||||
virtual void registerNotifyClient(NotifyClient *nc) ;
|
||||
|
||||
/* Control over Messages */
|
||||
virtual bool GetSysMessageList(std::map<uint32_t, std::string> &list);
|
||||
virtual bool GetPopupMessageList(std::map<uint32_t, std::string> &list);
|
||||
/* Pull output methods for retroshare-gui */
|
||||
virtual bool NotifySysMessage(uint32_t &sysid, uint32_t &type, std::string &title, std::string &msg);
|
||||
virtual bool NotifyPopupMessage(uint32_t &ptype, std::string &name, std::string &title, std::string &msg);
|
||||
virtual bool NotifyLogMessage(uint32_t &sysid, uint32_t &type, std::string &title, std::string &msg);
|
||||
|
||||
virtual bool SetSysMessageMode(uint32_t sysid, uint32_t mode);
|
||||
virtual bool SetPopupMessageMode(uint32_t ptype, uint32_t mode);
|
||||
virtual bool GetFeedItem(RsFeedItem &item);
|
||||
|
||||
virtual bool GetFeedItem(RsFeedItem &item);
|
||||
/* Control over Messages */
|
||||
bool GetSysMessageList(std::map<uint32_t, std::string> &list);
|
||||
bool GetPopupMessageList(std::map<uint32_t, std::string> &list);
|
||||
|
||||
/* Overloaded from pqiNotify */
|
||||
virtual bool AddPopupMessage(uint32_t ptype, const std::string& name, const std::string& title, const std::string& msg);
|
||||
virtual bool AddSysMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg);
|
||||
virtual bool AddLogMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg);
|
||||
virtual bool AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3);
|
||||
virtual bool AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3,const std::string& id4);
|
||||
virtual bool ClearFeedItems(uint32_t type);
|
||||
bool SetSysMessageMode(uint32_t sysid, uint32_t mode);
|
||||
bool SetPopupMessageMode(uint32_t ptype, uint32_t mode);
|
||||
|
||||
/* Overloaded from pqiNotify */
|
||||
virtual bool AddPopupMessage(uint32_t ptype, const std::string& name, const std::string& title, const std::string& msg);
|
||||
virtual bool AddSysMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg);
|
||||
virtual bool AddLogMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg);
|
||||
virtual bool AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3);
|
||||
virtual bool AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3,const std::string& id4);
|
||||
virtual bool ClearFeedItems(uint32_t type);
|
||||
|
||||
// Notifications of clients. Can be called from anywhere inside libretroshare.
|
||||
//
|
||||
void notifyListPreChange (int /* list */, int /* type */) ;
|
||||
void notifyListChange (int /* list */, int /* type */) ;
|
||||
void notifyErrorMsg (int /* list */, int /* sev */, std::string /* msg */) ;
|
||||
void notifyChatStatus (const std::string& /* peer_id */, const std::string& /* status_string */ ,bool /* is_private */) ;
|
||||
void notifyChatLobbyEvent (uint64_t /* lobby id */, uint32_t /* event type */ ,const std::string& /* 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 */) ;
|
||||
void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list<TurtleFileInfo>& /* files */) ;
|
||||
void notifyPeerHasNewAvatar (std::string /* peer_id */) ;
|
||||
void notifyOwnAvatarChanged () ;
|
||||
void notifyOwnStatusMessageChanged () ;
|
||||
void notifyDiskFull (uint32_t /* location */, uint32_t /* size limit in MB */) ;
|
||||
void notifyPeerStatusChanged (const std::string& /* peer_id */, uint32_t /* status */) ;
|
||||
|
||||
void notifyPeerStatusChangedSummary () ;
|
||||
void notifyDiscInfoChanged () ;
|
||||
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 */) ;
|
||||
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 */) ;
|
||||
void notifyHistoryChanged (uint32_t /* msgId */, int /* type */) ;
|
||||
|
||||
bool askForPassword (const std::string& /* key_details */, bool /* prev_is_bad */, std::string& /* password */ ) ;
|
||||
bool askForPluginConfirmation (const std::string& /* plugin_filename */, const std::string& /* plugin_file_hash */) ;
|
||||
|
||||
private:
|
||||
|
||||
RsMutex noteMtx;
|
||||
RsMutex noteMtx;
|
||||
|
||||
std::list<p3NotifySysMsg> pendingSysMsgs;
|
||||
std::list<p3NotifyLogMsg> pendingLogMsgs;
|
||||
std::list<p3NotifyPopupMsg> pendingPopupMsgs;
|
||||
std::list<RsFeedItem> pendingNewsFeed;
|
||||
std::list<p3NotifySysMsg> pendingSysMsgs;
|
||||
std::list<p3NotifyLogMsg> pendingLogMsgs;
|
||||
std::list<p3NotifyPopupMsg> pendingPopupMsgs;
|
||||
std::list<RsFeedItem> pendingNewsFeed;
|
||||
|
||||
std::list<NotifyClient*> notifyClients ;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "rsserver/p3face.h"
|
||||
#include "util/rsnet.h"
|
||||
#include "pqi/authgpg.h"
|
||||
#include "pqi/authssl.h"
|
||||
|
@ -43,7 +44,6 @@
|
|||
const int p3peermgrzone = 9531;
|
||||
|
||||
#include "serialiser/rsconfigitems.h"
|
||||
#include "pqi/pqinotify.h"
|
||||
|
||||
#include "retroshare/rsiface.h" // Needed for rsicontrol (should remove this dependancy)
|
||||
#include "retroshare/rspeers.h" // Needed for Group Parameters.
|
||||
|
@ -1689,7 +1689,7 @@ bool p3PeerMgrIMPL::addGroup(RsGroupInfo &groupInfo)
|
|||
groupInfo.id = groupItem->id;
|
||||
}
|
||||
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_ADD);
|
||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_ADD);
|
||||
|
||||
IndicateConfigChanged();
|
||||
|
||||
|
@ -1725,7 +1725,7 @@ bool p3PeerMgrIMPL::editGroup(const std::string &groupId, RsGroupInfo &groupInfo
|
|||
}
|
||||
|
||||
if (changed) {
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_MOD);
|
||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_MOD);
|
||||
|
||||
IndicateConfigChanged();
|
||||
}
|
||||
|
@ -1763,7 +1763,7 @@ bool p3PeerMgrIMPL::removeGroup(const std::string &groupId)
|
|||
}
|
||||
|
||||
if (changed) {
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_DEL);
|
||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_DEL);
|
||||
|
||||
IndicateConfigChanged();
|
||||
}
|
||||
|
@ -1850,7 +1850,7 @@ bool p3PeerMgrIMPL::assignPeersToGroup(const std::string &groupId, const std::li
|
|||
}
|
||||
|
||||
if (changed) {
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_MOD);
|
||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_GROUPLIST, NOTIFY_TYPE_MOD);
|
||||
|
||||
IndicateConfigChanged();
|
||||
}
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
#ifndef PQI_NOTIFY_INTERFACE_H
|
||||
#define PQI_NOTIFY_INTERFACE_H
|
||||
|
||||
/*
|
||||
* libretroshare/src/rsserver: pqinotify.h
|
||||
*
|
||||
* RetroShare C++ Interface.
|
||||
*
|
||||
* Copyright 2007-2008 by Robert Fernie.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
||||
*
|
||||
*/
|
||||
|
||||
#include "retroshare/rsnotify.h" /* for ids */
|
||||
|
||||
/* Interface for System Notification: Implemented in rsserver */
|
||||
/* Global Access -> so we don't need everyone to have a pointer to this! */
|
||||
|
||||
|
||||
class pqiNotify
|
||||
{
|
||||
public:
|
||||
|
||||
pqiNotify() { return; }
|
||||
virtual ~pqiNotify() { return; }
|
||||
|
||||
/* Input from libretroshare */
|
||||
virtual bool AddPopupMessage(uint32_t ptype, const std::string& name, const std::string& title, const std::string& msg) = 0;
|
||||
virtual bool AddSysMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg) = 0;
|
||||
virtual bool AddLogMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg) = 0;
|
||||
virtual bool AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3) = 0;
|
||||
virtual bool AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3, const std::string& id4) = 0;
|
||||
virtual bool ClearFeedItems(uint32_t type) = 0;
|
||||
};
|
||||
|
||||
extern pqiNotify *getPqiNotify();
|
||||
|
||||
#endif
|
|
@ -31,7 +31,7 @@
|
|||
#include "util/rsstring.h"
|
||||
|
||||
#include "pqi/pqistreamer.h"
|
||||
#include "pqi/pqinotify.h"
|
||||
#include "rsserver/p3face.h"
|
||||
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rsbaseitems.h" /***** For RsFileData *****/
|
||||
|
@ -550,7 +550,7 @@ continue_packet:
|
|||
{
|
||||
pqioutput(PQL_ALERT, pqistreamerzone, "ERROR: Read Packet too Big!");
|
||||
|
||||
pqiNotify *notify = getPqiNotify();
|
||||
p3Notify *notify = RsServer::notify();
|
||||
if (notify)
|
||||
{
|
||||
std::string title =
|
||||
|
@ -625,7 +625,7 @@ continue_packet:
|
|||
std::cerr << out << std::endl ;
|
||||
pqioutput(PQL_ALERT, pqistreamerzone, out);
|
||||
|
||||
pqiNotify *notify = getPqiNotify();
|
||||
p3Notify *notify = RsServer::notify();
|
||||
if (notify)
|
||||
{
|
||||
std::string title = "Warning: Error Completing Read";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue