1 /***************************************************************************
2 * Copyright (C) 2005-2018 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #include "coresession.h"
26 #include "coreuserinputhandler.h"
27 #include "corebuffersyncer.h"
28 #include "corebacklogmanager.h"
29 #include "corebufferviewmanager.h"
30 #include "coredccconfig.h"
31 #include "coreeventmanager.h"
32 #include "coreidentity.h"
33 #include "coreignorelistmanager.h"
34 #include "coreirclisthelper.h"
35 #include "corenetwork.h"
36 #include "corenetworkconfig.h"
37 #include "coresessioneventprocessor.h"
38 #include "coretransfermanager.h"
39 #include "coreusersettings.h"
40 #include "ctcpparser.h"
41 #include "eventstringifier.h"
42 #include "internalpeer.h"
43 #include "ircchannel.h"
44 #include "ircparser.h"
47 #include "messageevent.h"
48 #include "remotepeer.h"
53 class ProcessMessagesEvent : public QEvent
56 ProcessMessagesEvent() : QEvent(QEvent::User) {}
60 CoreSession::CoreSession(UserId uid, bool restoreState, QObject *parent)
63 _signalProxy(new SignalProxy(SignalProxy::Server, this)),
65 _bufferSyncer(new CoreBufferSyncer(this)),
66 _backlogManager(new CoreBacklogManager(this)),
67 _bufferViewManager(new CoreBufferViewManager(_signalProxy, this)),
68 _dccConfig(new CoreDccConfig(this)),
69 _ircListHelper(new CoreIrcListHelper(this)),
70 _networkConfig(new CoreNetworkConfig("GlobalNetworkConfig", this)),
72 _transferManager(new CoreTransferManager(this)),
73 _eventManager(new CoreEventManager(this)),
74 _eventStringifier(new EventStringifier(this)),
75 _sessionEventProcessor(new CoreSessionEventProcessor(this)),
76 _ctcpParser(new CtcpParser(this)),
77 _ircParser(new IrcParser(this)),
78 scriptEngine(new QScriptEngine(this)),
79 _processMessages(false),
80 _ignoreListManager(this),
81 _highlightRuleManager(this)
83 SignalProxy *p = signalProxy();
84 p->setHeartBeatInterval(30);
85 p->setMaxHeartBeatCount(60); // 30 mins until we throw a dead socket out
87 connect(p, SIGNAL(peerRemoved(Peer*)), SLOT(removeClient(Peer*)));
89 connect(p, SIGNAL(connected()), SLOT(clientsConnected()));
90 connect(p, SIGNAL(disconnected()), SLOT(clientsDisconnected()));
92 p->attachSlot(SIGNAL(sendInput(BufferInfo, QString)), this, SLOT(msgFromClient(BufferInfo, QString)));
93 p->attachSignal(this, SIGNAL(displayMsg(Message)));
94 p->attachSignal(this, SIGNAL(displayStatusMsg(QString, QString)));
96 p->attachSignal(this, SIGNAL(identityCreated(const Identity &)));
97 p->attachSignal(this, SIGNAL(identityRemoved(IdentityId)));
98 p->attachSlot(SIGNAL(createIdentity(const Identity &, const QVariantMap &)), this, SLOT(createIdentity(const Identity &, const QVariantMap &)));
99 p->attachSlot(SIGNAL(removeIdentity(IdentityId)), this, SLOT(removeIdentity(IdentityId)));
101 p->attachSignal(this, SIGNAL(networkCreated(NetworkId)));
102 p->attachSignal(this, SIGNAL(networkRemoved(NetworkId)));
103 p->attachSlot(SIGNAL(createNetwork(const NetworkInfo &, const QStringList &)), this, SLOT(createNetwork(const NetworkInfo &, const QStringList &)));
104 p->attachSlot(SIGNAL(removeNetwork(NetworkId)), this, SLOT(removeNetwork(NetworkId)));
106 p->attachSlot(SIGNAL(changePassword(PeerPtr,QString,QString,QString)), this, SLOT(changePassword(PeerPtr,QString,QString,QString)));
107 p->attachSignal(this, SIGNAL(passwordChanged(PeerPtr,bool)));
109 p->attachSlot(SIGNAL(kickClient(int)), this, SLOT(kickClient(int)));
110 p->attachSignal(this, SIGNAL(disconnectFromCore()));
115 eventManager()->registerObject(ircParser(), EventManager::NormalPriority);
116 eventManager()->registerObject(sessionEventProcessor(), EventManager::HighPriority); // needs to process events *before* the stringifier!
117 eventManager()->registerObject(ctcpParser(), EventManager::NormalPriority);
118 eventManager()->registerObject(eventStringifier(), EventManager::NormalPriority);
119 eventManager()->registerObject(this, EventManager::LowPriority); // for sending MessageEvents to the client
120 // some events need to be handled after msg generation
121 eventManager()->registerObject(sessionEventProcessor(), EventManager::LowPriority, "lateProcess");
122 eventManager()->registerObject(ctcpParser(), EventManager::LowPriority, "send");
124 // periodically save our session state
125 connect(&(Core::instance()->syncTimer()), SIGNAL(timeout()), this, SLOT(saveSessionState()));
127 p->synchronize(_bufferSyncer);
128 p->synchronize(&aliasManager());
129 p->synchronize(_backlogManager);
130 p->synchronize(dccConfig());
131 p->synchronize(ircListHelper());
132 p->synchronize(networkConfig());
133 p->synchronize(&_coreInfo);
134 p->synchronize(&_ignoreListManager);
135 p->synchronize(&_highlightRuleManager);
136 p->synchronize(transferManager());
137 // Restore session state
139 restoreSessionState();
145 CoreSession::~CoreSession()
149 /* Why partially duplicate CoreNetwork destructor? When each CoreNetwork quits in the
150 * destructor, disconnections are processed in sequence for each object. For many IRC servers
151 * on a slow network, this could significantly delay core shutdown [msecs wait * network count].
153 * Here, CoreSession first calls disconnect on all networks, letting them all start
154 * disconnecting before beginning to sequentially wait for each network. Ideally, after the
155 * first network is disconnected, the other networks will have already closed. Worst-case may
156 * still wait [msecs wait time * num. of networks], but the risk should be much lower.
158 * CoreNetwork should still do cleanup in its own destructor in case a network is deleted
159 * outside of deleting the whole CoreSession.
161 * If this proves to be problematic in the future, there's an alternative Qt signal-based system
162 * implemented in another pull request that guarentees a maximum amount of time to disconnect,
163 * but at the cost of more complex code.
165 * See https://github.com/quassel/quassel/pull/203
168 foreach(CoreNetwork *net, _networks.values()) {
169 // Request each network properly disconnect, but don't count as user-requested disconnect
170 if (net->socketConnected()) {
171 // Only try if the socket's fully connected (not initializing or disconnecting).
172 // Force an immediate disconnect, jumping the command queue. Ensures the proper QUIT is
173 // shown even if other messages are queued.
174 net->disconnectFromIrc(false, QString(), false, true);
178 // Process the putCmd events that trigger the quit. Without this, shutting down the core
179 // results in abrubtly closing the socket rather than sending the QUIT as expected.
180 QCoreApplication::processEvents();
182 foreach(CoreNetwork *net, _networks.values()) {
183 // Wait briefly for each network to disconnect. Sometimes it takes a little while to send.
184 if (!net->forceDisconnect()) {
185 qWarning() << "Timed out quitting network" << net->networkName() <<
186 "(user ID " << net->userId() << ")";
188 // Delete the network now that it's closed
194 CoreNetwork *CoreSession::network(NetworkId id) const
196 if (_networks.contains(id)) return _networks[id];
201 CoreIdentity *CoreSession::identity(IdentityId id) const
203 if (_identities.contains(id)) return _identities[id];
208 void CoreSession::loadSettings()
210 CoreUserSettings s(user());
213 QList<IdentityId> ids = s.identityIds();
214 QList<NetworkInfo> networkInfos = Core::networks(user());
215 foreach(IdentityId id, ids) {
216 CoreIdentity identity(s.identity(id));
217 IdentityId newId = Core::createIdentity(user(), identity);
218 QList<NetworkInfo>::iterator networkIter = networkInfos.begin();
219 while (networkIter != networkInfos.end()) {
220 if (networkIter->identity == id) {
221 networkIter->identity = newId;
222 Core::updateNetwork(user(), *networkIter);
223 networkIter = networkInfos.erase(networkIter);
229 s.removeIdentity(id);
233 foreach(CoreIdentity identity, Core::identities(user())) {
234 createIdentity(identity);
237 foreach(NetworkInfo info, Core::networks(user())) {
243 void CoreSession::saveSessionState() const
245 _bufferSyncer->storeDirtyIds();
246 _bufferViewManager->saveBufferViews();
247 _networkConfig->save();
251 void CoreSession::restoreSessionState()
253 QList<NetworkId> nets = Core::connectedNetworks(user());
254 CoreNetwork *net = 0;
255 foreach(NetworkId id, nets) {
263 void CoreSession::addClient(RemotePeer *peer)
265 peer->dispatch(sessionState());
266 signalProxy()->addPeer(peer);
270 void CoreSession::addClient(InternalPeer *peer)
272 signalProxy()->addPeer(peer);
273 emit sessionState(sessionState());
277 void CoreSession::removeClient(Peer *peer)
279 RemotePeer *p = qobject_cast<RemotePeer *>(peer);
281 quInfo() << qPrintable(tr("Client")) << p->description() << qPrintable(tr("disconnected (UserId: %1).").arg(user().toInt()));
285 QHash<QString, QString> CoreSession::persistentChannels(NetworkId id) const
287 return Core::persistentChannels(user(), id);
291 // FIXME switch to BufferId
292 void CoreSession::msgFromClient(BufferInfo bufinfo, QString msg)
294 CoreNetwork *net = network(bufinfo.networkId());
296 net->userInput(bufinfo, msg);
299 qWarning() << "Trying to send to unconnected network:" << msg;
304 // ALL messages coming pass through these functions before going to the GUI.
305 // So this is the perfect place for storing the backlog and log stuff.
306 void CoreSession::recvMessageFromServer(NetworkId networkId, Message::Type type, BufferInfo::Type bufferType,
307 const QString &target, const QString &text_, const QString &sender, Message::Flags flags)
309 // U+FDD0 and U+FDD1 are special characters for Qt's text engine, specifically they mark the boundaries of
310 // text frames in a QTextDocument. This might lead to problems in widgets displaying QTextDocuments (such as
311 // KDE's notifications), hence we remove those just to be safe.
312 QString text = text_;
313 text.remove(QChar(0xfdd0)).remove(QChar(0xfdd1));
314 RawMessage rawMsg(networkId, type, bufferType, target, text, sender, flags);
316 // check for HardStrictness ignore
317 CoreNetwork *currentNetwork = network(networkId);
318 QString networkName = currentNetwork ? currentNetwork->networkName() : QString("");
319 if (_ignoreListManager.match(rawMsg, networkName) == IgnoreListManager::HardStrictness)
322 if (_highlightRuleManager.match(rawMsg, currentNetwork->myNick(), currentNetwork->identityPtr()->nicks()))
323 rawMsg.flags |= Message::Flag::Highlight;
325 _messageQueue << rawMsg;
326 if (!_processMessages) {
327 _processMessages = true;
328 QCoreApplication::postEvent(this, new ProcessMessagesEvent());
333 void CoreSession::recvStatusMsgFromServer(QString msg)
335 CoreNetwork *net = qobject_cast<CoreNetwork *>(sender());
337 emit displayStatusMsg(net->networkName(), msg);
341 void CoreSession::processMessageEvent(MessageEvent *event)
343 recvMessageFromServer(event->networkId(), event->msgType(), event->bufferType(),
344 event->target().isNull() ? "" : event->target(),
345 event->text().isNull() ? "" : event->text(),
346 event->sender().isNull() ? "" : event->sender(),
351 QList<BufferInfo> CoreSession::buffers() const
353 return Core::requestBuffers(user());
357 void CoreSession::customEvent(QEvent *event)
359 if (event->type() != QEvent::User)
367 void CoreSession::processMessages()
369 if (_messageQueue.count() == 1) {
370 const RawMessage &rawMsg = _messageQueue.first();
371 bool createBuffer = !(rawMsg.flags & Message::Redirected);
372 BufferInfo bufferInfo = Core::bufferInfo(user(), rawMsg.networkId, rawMsg.bufferType, rawMsg.target, createBuffer);
373 if (!bufferInfo.isValid()) {
374 Q_ASSERT(!createBuffer);
375 bufferInfo = Core::bufferInfo(user(), rawMsg.networkId, BufferInfo::StatusBuffer, "");
377 Message msg(bufferInfo, rawMsg.type, rawMsg.text, rawMsg.sender,
378 senderPrefixes(rawMsg.sender, bufferInfo), rawMsg.flags);
379 if(Core::storeMessage(msg))
380 emit displayMsg(msg);
383 QHash<NetworkId, QHash<QString, BufferInfo> > bufferInfoCache;
384 MessageList messages;
385 QList<RawMessage> redirectedMessages; // list of Messages which don't enforce a buffer creation
386 BufferInfo bufferInfo;
387 for (int i = 0; i < _messageQueue.count(); i++) {
388 const RawMessage &rawMsg = _messageQueue.at(i);
389 if (bufferInfoCache.contains(rawMsg.networkId) && bufferInfoCache[rawMsg.networkId].contains(rawMsg.target)) {
390 bufferInfo = bufferInfoCache[rawMsg.networkId][rawMsg.target];
393 bool createBuffer = !(rawMsg.flags & Message::Redirected);
394 bufferInfo = Core::bufferInfo(user(), rawMsg.networkId, rawMsg.bufferType, rawMsg.target, createBuffer);
395 if (!bufferInfo.isValid()) {
396 Q_ASSERT(!createBuffer);
397 redirectedMessages << rawMsg;
400 bufferInfoCache[rawMsg.networkId][rawMsg.target] = bufferInfo;
402 Message msg(bufferInfo, rawMsg.type, rawMsg.text, rawMsg.sender,
403 senderPrefixes(rawMsg.sender, bufferInfo), rawMsg.flags);
407 // recheck if there exists a buffer to store a redirected message in
408 for (int i = 0; i < redirectedMessages.count(); i++) {
409 const RawMessage &rawMsg = redirectedMessages.at(i);
410 if (bufferInfoCache.contains(rawMsg.networkId) && bufferInfoCache[rawMsg.networkId].contains(rawMsg.target)) {
411 bufferInfo = bufferInfoCache[rawMsg.networkId][rawMsg.target];
414 // no luck -> we store them in the StatusBuffer
415 bufferInfo = Core::bufferInfo(user(), rawMsg.networkId, BufferInfo::StatusBuffer, "");
416 // add the StatusBuffer to the Cache in case there are more Messages for the original target
417 bufferInfoCache[rawMsg.networkId][rawMsg.target] = bufferInfo;
419 Message msg(bufferInfo, rawMsg.type, rawMsg.text, rawMsg.sender,
420 senderPrefixes(rawMsg.sender, bufferInfo), rawMsg.flags);
424 if(Core::storeMessages(messages)) {
425 // FIXME: extend protocol to a displayMessages(MessageList)
426 for (int i = 0; i < messages.count(); i++) {
427 emit displayMsg(messages[i]);
431 _processMessages = false;
432 _messageQueue.clear();
435 QString CoreSession::senderPrefixes(const QString &sender, const BufferInfo &bufferInfo) const
437 CoreNetwork *currentNetwork = network(bufferInfo.networkId());
438 if (!currentNetwork) {
442 if (bufferInfo.type() != BufferInfo::ChannelBuffer) {
446 IrcChannel *currentChannel = currentNetwork->ircChannel(bufferInfo.bufferName());
447 if (!currentChannel) {
451 const QString modes = currentChannel->userModes(nickFromMask(sender).toLower());
452 return currentNetwork->modesToPrefixes(modes);
455 Protocol::SessionState CoreSession::sessionState() const
457 QVariantList bufferInfos;
458 QVariantList networkIds;
459 QVariantList identities;
461 foreach(const BufferInfo &id, buffers())
462 bufferInfos << QVariant::fromValue(id);
463 foreach(const NetworkId &id, _networks.keys())
464 networkIds << QVariant::fromValue(id);
465 foreach(const Identity *i, _identities.values())
466 identities << QVariant::fromValue(*i);
468 return Protocol::SessionState(identities, bufferInfos, networkIds);
472 void CoreSession::initScriptEngine()
474 signalProxy()->attachSlot(SIGNAL(scriptRequest(QString)), this, SLOT(scriptRequest(QString)));
475 signalProxy()->attachSignal(this, SIGNAL(scriptResult(QString)));
478 //QScriptValue storage_ = scriptEngine->newQObject(storage);
479 //scriptEngine->globalObject().setProperty("storage", storage_);
483 void CoreSession::scriptRequest(QString script)
485 emit scriptResult(scriptEngine->evaluate(script).toString());
489 /*** Identity Handling ***/
490 void CoreSession::createIdentity(const Identity &identity, const QVariantMap &additional)
496 CoreIdentity coreIdentity(identity);
498 if (additional.contains("KeyPem"))
499 coreIdentity.setSslKey(additional["KeyPem"].toByteArray());
500 if (additional.contains("CertPem"))
501 coreIdentity.setSslCert(additional["CertPem"].toByteArray());
503 qDebug() << Q_FUNC_INFO;
504 IdentityId id = Core::createIdentity(user(), coreIdentity);
508 createIdentity(coreIdentity);
511 const QString CoreSession::strictSysident() {
512 return Core::instance()->strictSysIdent(_user);
515 void CoreSession::createIdentity(const CoreIdentity &identity)
517 CoreIdentity *coreIdentity = new CoreIdentity(identity, this);
518 _identities[identity.id()] = coreIdentity;
519 // CoreIdentity has its own synchronize method since its "private" sslManager needs to be synced as well
520 coreIdentity->synchronize(signalProxy());
521 connect(coreIdentity, SIGNAL(updated()), this, SLOT(updateIdentityBySender()));
522 emit identityCreated(*coreIdentity);
526 void CoreSession::updateIdentityBySender()
528 CoreIdentity *identity = qobject_cast<CoreIdentity *>(sender());
531 Core::updateIdentity(user(), *identity);
535 void CoreSession::removeIdentity(IdentityId id)
537 CoreIdentity *identity = _identities.take(id);
539 emit identityRemoved(id);
540 Core::removeIdentity(user(), id);
541 identity->deleteLater();
546 /*** Network Handling ***/
548 void CoreSession::createNetwork(const NetworkInfo &info_, const QStringList &persistentChans)
550 NetworkInfo info = info_;
553 if (!info.networkId.isValid())
554 Core::createNetwork(user(), info);
556 if (!info.networkId.isValid()) {
557 qWarning() << qPrintable(tr("CoreSession::createNetwork(): Got invalid networkId from Core when trying to create network %1!").arg(info.networkName));
561 id = info.networkId.toInt();
562 if (!_networks.contains(id)) {
563 // create persistent chans
564 QRegExp rx("\\s*(\\S+)(?:\\s*(\\S+))?\\s*");
565 foreach(QString channel, persistentChans) {
566 if (!rx.exactMatch(channel)) {
567 qWarning() << QString("Invalid persistent channel declaration: %1").arg(channel);
570 Core::bufferInfo(user(), info.networkId, BufferInfo::ChannelBuffer, rx.cap(1), true);
571 Core::setChannelPersistent(user(), info.networkId, rx.cap(1), true);
572 if (!rx.cap(2).isEmpty())
573 Core::setPersistentChannelKey(user(), info.networkId, rx.cap(1), rx.cap(2));
576 CoreNetwork *net = new CoreNetwork(id, this);
577 connect(net, SIGNAL(displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)),
578 SLOT(recvMessageFromServer(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)));
579 connect(net, SIGNAL(displayStatusMsg(QString)), SLOT(recvStatusMsgFromServer(QString)));
580 connect(net, SIGNAL(disconnected(NetworkId)), SIGNAL(networkDisconnected(NetworkId)));
582 net->setNetworkInfo(info);
583 net->setProxy(signalProxy());
585 signalProxy()->synchronize(net);
586 emit networkCreated(id);
589 qWarning() << qPrintable(tr("CoreSession::createNetwork(): Trying to create a network that already exists, updating instead!"));
590 _networks[info.networkId]->requestSetNetworkInfo(info);
595 void CoreSession::removeNetwork(NetworkId id)
597 // Make sure the network is disconnected!
598 CoreNetwork *net = network(id);
602 if (net->connectionState() != Network::Disconnected) {
603 // make sure we no longer receive data from the tcp buffer
604 disconnect(net, SIGNAL(displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)), this, 0);
605 disconnect(net, SIGNAL(displayStatusMsg(QString)), this, 0);
606 connect(net, SIGNAL(disconnected(NetworkId)), this, SLOT(destroyNetwork(NetworkId)));
607 net->disconnectFromIrc();
615 void CoreSession::destroyNetwork(NetworkId id)
617 QList<BufferId> removedBuffers = Core::requestBufferIdsForNetwork(user(), id);
618 Network *net = _networks.take(id);
619 if (net && Core::removeNetwork(user(), id)) {
620 // make sure that all unprocessed RawMessages from this network are removed
621 QList<RawMessage>::iterator messageIter = _messageQueue.begin();
622 while (messageIter != _messageQueue.end()) {
623 if (messageIter->networkId == id) {
624 messageIter = _messageQueue.erase(messageIter);
630 // remove buffers from syncer
631 foreach(BufferId bufferId, removedBuffers) {
632 _bufferSyncer->removeBuffer(bufferId);
634 emit networkRemoved(id);
640 void CoreSession::renameBuffer(const NetworkId &networkId, const QString &newName, const QString &oldName)
642 BufferInfo bufferInfo = Core::bufferInfo(user(), networkId, BufferInfo::QueryBuffer, oldName, false);
643 if (bufferInfo.isValid()) {
644 _bufferSyncer->renameBuffer(bufferInfo.bufferId(), newName);
649 void CoreSession::clientsConnected()
651 QHash<NetworkId, CoreNetwork *>::iterator netIter = _networks.begin();
652 Identity *identity = 0;
653 CoreNetwork *net = 0;
655 while (netIter != _networks.end()) {
659 if (!net->isConnected())
661 identity = net->identityPtr();
668 if (identity->detachAwayEnabled() && me->isAway()) {
669 net->userInputHandler()->handleAway(BufferInfo(), QString());
675 void CoreSession::clientsDisconnected()
677 QHash<NetworkId, CoreNetwork *>::iterator netIter = _networks.begin();
678 Identity *identity = 0;
679 CoreNetwork *net = 0;
682 while (netIter != _networks.end()) {
686 if (!net->isConnected())
689 identity = net->identityPtr();
696 if (identity->detachAwayEnabled() && !me->isAway()) {
697 if (!identity->detachAwayReason().isEmpty())
698 awayReason = identity->detachAwayReason();
699 net->setAutoAwayActive(true);
700 // Allow handleAway() to format the current date/time in the string.
701 net->userInputHandler()->handleAway(BufferInfo(), awayReason);
707 void CoreSession::globalAway(const QString &msg, const bool skipFormatting)
709 QHash<NetworkId, CoreNetwork *>::iterator netIter = _networks.begin();
710 CoreNetwork *net = 0;
711 while (netIter != _networks.end()) {
715 if (!net->isConnected())
718 net->userInputHandler()->issueAway(msg, false /* no force away */, skipFormatting);
722 void CoreSession::changePassword(PeerPtr peer, const QString &userName, const QString &oldPassword, const QString &newPassword) {
725 bool success = false;
726 UserId uid = Core::validateUser(userName, oldPassword);
727 if (uid.isValid() && uid == user())
728 success = Core::changeUserPassword(uid, newPassword);
730 signalProxy()->restrictTargetPeers(signalProxy()->sourcePeer(), [&]{
731 emit passwordChanged(nullptr, success);
735 void CoreSession::kickClient(int peerId) {
736 auto peer = signalProxy()->peerById(peerId);
737 if (peer == nullptr) {
738 qWarning() << "Invalid peer Id: " << peerId;
741 signalProxy()->restrictTargetPeers(peer, [&]{
742 emit disconnectFromCore();