If this is set, the EventStringifier won't generate a MessageEvent for this event.
This is thought for the CoreSessionEventProcessor (and possibly scripts) to hide
messages in certain cases, without circumventing further processing of the event.
Example would be suppressing WHO messages on autowho.
+ Backlog = 0x20,
+ Silent = 0x40, ///< Don't generate a MessageEvent
Stopped = 0x80
};
Q_DECLARE_FLAGS(EventFlags, EventFlag)
Stopped = 0x80
};
Q_DECLARE_FLAGS(EventFlags, EventFlag)
if(me)
me->setAway(false);
if(me)
me->setAway(false);
- if(e->network()->autoAwayActive())
+ if(e->network()->autoAwayActive()) {
e->network()->setAutoAwayActive(false);
e->network()->setAutoAwayActive(false);
+ e->setFlag(EventManager::Silent);
+ }
}
/* RPL_NOWAWAY - ":You have been marked as being away" */
}
/* RPL_NOWAWAY - ":You have been marked as being away" */
void EventStringifier::displayMsg(NetworkEvent *event, Message::Type msgType, const QString &msg, const QString &sender,
const QString &target, Message::Flags msgFlags) {
void EventStringifier::displayMsg(NetworkEvent *event, Message::Type msgType, const QString &msg, const QString &sender,
const QString &target, Message::Flags msgFlags) {
+ if(event->flags().testFlag(EventManager::Silent))
+ return;
+
MessageEvent *msgEvent = createMessageEvent(event, msgType, msg, sender, target, msgFlags);
sendMessageEvent(msgEvent);
}
MessageEvent *msgEvent = createMessageEvent(event, msgType, msg, sender, target, msgFlags);
sendMessageEvent(msgEvent);
}
-void EventStringifier::earlyProcessIrcEvent305(IrcEvent *e) {
- // needs to be called early so we still get the old autoAwayActive state!
- if(!e->network()->autoAwayActive())
- displayMsg(e, Message::Server, tr("You are no longer marked as being away"));
+void EventStringifier::processIrcEvent305(IrcEvent *e) {
+ displayMsg(e, Message::Server, tr("You are no longer marked as being away"));
Q_INVOKABLE void processIrcEventTopic(IrcEvent *event);
Q_INVOKABLE void processIrcEvent301(IrcEvent *event); // RPL_AWAY
Q_INVOKABLE void processIrcEventTopic(IrcEvent *event);
Q_INVOKABLE void processIrcEvent301(IrcEvent *event); // RPL_AWAY
- Q_INVOKABLE void earlyProcessIrcEvent305(IrcEvent *event); // RPL_UNAWAY
+ Q_INVOKABLE void processIrcEvent305(IrcEvent *event); // RPL_UNAWAY
Q_INVOKABLE void processIrcEvent306(IrcEvent *event); // RPL_NOWAWAY
// Q_INVOKABLE void processIrcEvent(IrcEvent *event);
Q_INVOKABLE void processIrcEvent306(IrcEvent *event); // RPL_NOWAWAY
// Q_INVOKABLE void processIrcEvent(IrcEvent *event);