projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
displaying own quit message
[quassel.git]
/
src
/
core
/
corenetwork.cpp
diff --git
a/src/core/corenetwork.cpp
b/src/core/corenetwork.cpp
index
7d62b76
..
b9e82e4
100644
(file)
--- a/
src/core/corenetwork.cpp
+++ b/
src/core/corenetwork.cpp
@@
-137,6
+137,10
@@
void CoreNetwork::connectToIrc(bool reconnecting) {
qWarning() << "Invalid identity configures, ignoring connect request!";
return;
}
qWarning() << "Invalid identity configures, ignoring connect request!";
return;
}
+
+ // cleaning up old quit reason
+ _quitReason.clear();
+
// use a random server?
if(useRandomServer()) {
_lastUsedServerIndex = qrand() % serverList().size();
// use a random server?
if(useRandomServer()) {
_lastUsedServerIndex = qrand() % serverList().size();
@@
-202,7
+206,11
@@
void CoreNetwork::disconnectFromIrc(bool requested, const QString &reason) {
socketDisconnected();
} else {
// quit gracefully if it's user requested quit
socketDisconnected();
} else {
// quit gracefully if it's user requested quit
- userInputHandler()->issueQuit(reason);
+ if(reason.isEmpty() && identityPtr())
+ _quitReason = identityPtr()->quitReason();
+ else
+ _quitReason = reason;
+ userInputHandler()->issueQuit(_quitReason);
// the irc server has 10 seconds to close the socket
_socketCloseTimer.start(10000);
}
// the irc server has 10 seconds to close the socket
_socketCloseTimer.start(10000);
}
@@
-337,7
+345,7
@@
void CoreNetwork::socketDisconnected() {
IrcUser *me_ = me();
if(me_) {
foreach(QString channel, me_->channels())
IrcUser *me_ = me();
if(me_) {
foreach(QString channel, me_->channels())
- emit displayMsg(Message::Quit, BufferInfo::ChannelBuffer, channel,
""
, me_->hostmask());
+ emit displayMsg(Message::Quit, BufferInfo::ChannelBuffer, channel,
_quitReason
, me_->hostmask());
}
setConnected(false);
}
setConnected(false);