projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common: Prepare Quassel::quit() to be used more widely
[quassel.git]
/
src
/
common
/
remotepeer.cpp
diff --git
a/src/common/remotepeer.cpp
b/src/common/remotepeer.cpp
index
e8fa578
..
36c56ba
100644
(file)
--- a/
src/common/remotepeer.cpp
+++ b/
src/common/remotepeer.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-201
5
by the Quassel Project *
+ * Copyright (C) 2005-201
8
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-91,6
+91,22
@@
QString RemotePeer::description() const
return QString();
}
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
{
::SignalProxy *RemotePeer::signalProxy() const
{
@@
-192,8
+208,15
@@
void RemotePeer::close(const QString &reason)
void RemotePeer::onReadyRead()
{
QByteArray msg;
void RemotePeer::onReadyRead()
{
QByteArray msg;
- while (readMessage(msg))
+ while (readMessage(msg)) {
+ if (SignalProxy::current())
+ SignalProxy::current()->setSourcePeer(this);
+
processMessage(msg);
processMessage(msg);
+
+ if (SignalProxy::current())
+ SignalProxy::current()->setSourcePeer(nullptr);
+ }
}
}