projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introducing global away
[quassel.git]
/
src
/
core
/
coreuserinputhandler.cpp
diff --git
a/src/core/coreuserinputhandler.cpp
b/src/core/coreuserinputhandler.cpp
index
ecff7ef
..
3184f25
100644
(file)
--- a/
src/core/coreuserinputhandler.cpp
+++ b/
src/core/coreuserinputhandler.cpp
@@
-51,14
+51,31
@@
void CoreUserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const Q
// ====================
void CoreUserInputHandler::handleAway(const BufferInfo &bufferInfo, const QString &msg) {
Q_UNUSED(bufferInfo)
// ====================
void CoreUserInputHandler::handleAway(const BufferInfo &bufferInfo, const QString &msg) {
Q_UNUSED(bufferInfo)
+ if(msg.startsWith("-all")) {
+ if(msg.length() == 4) {
+ coreSession()->globalAway();
+ return;
+ }
+ Q_ASSERT(msg.length() > 4);
+ if(msg[4] == ' ') {
+ coreSession()->globalAway(msg.mid(5));
+ return;
+ }
+ }
+ issueAway(msg);
+}
+void CoreUserInputHandler::issueAway(const QString &msg, bool autoCheck) {
QString awayMsg = msg;
IrcUser *me = network()->me();
// if there is no message supplied we have to check if we are already away or not
QString awayMsg = msg;
IrcUser *me = network()->me();
// if there is no message supplied we have to check if we are already away or not
- if(msg.isEmpty()) {
+ if(
autoCheck &&
msg.isEmpty()) {
if(me && !me->isAway()) {
if(me && !me->isAway()) {
- awayMsg = network()->identityPtr()->awayReason();
+ Identity *identity = network()->identityPtr();
+ if(identity) {
+ awayMsg = identity->awayReason();
+ }
if(awayMsg.isEmpty()) {
awayMsg = tr("away");
}
if(awayMsg.isEmpty()) {
awayMsg = tr("away");
}