/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
return QString();
}
+QString RemotePeer::address() const
+{
+ if (socket())
+ return socket()->peerAddress().toString();
+
+ return QString();
+}
+
+quint16 RemotePeer::port() const
+{
+ if (socket())
+ return socket()->peerPort();
+
+ return 0;
+}
+
::SignalProxy *RemotePeer::signalProxy() const
{
void RemotePeer::onReadyRead()
{
QByteArray msg;
- while (readMessage(msg))
+ while (readMessage(msg)) {
+ if (SignalProxy::current())
+ SignalProxy::current()->setSourcePeer(this);
+
processMessage(msg);
+
+ if (SignalProxy::current())
+ SignalProxy::current()->setSourcePeer(nullptr);
+ }
}