Browse Source

Fix away state dodgyness.

Since changing to events we need to fire when changing from
unknown->away. Before, this was handled by the Server being
told about the new message (and then firing listeners).

Fixes #391.
pull/396/head
Chris Smith 9 years ago
parent
commit
3993ee8156
1 changed files with 1 additions and 6 deletions
  1. 1
    6
      src/com/dmdirc/ServerEventHandler.java

+ 1
- 6
src/com/dmdirc/ServerEventHandler.java View File

@@ -358,16 +358,11 @@ public class ServerEventHandler extends EventHandler implements
358 358
 
359 359
         owner.updateAwayState(currentState == AwayState.AWAY ? Optional.of(reason) : Optional.empty());
360 360
 
361
-        if (oldState == AwayState.UNKNOWN) {
362
-            // Ignore discovered self away states
363
-            return;
364
-        }
365
-
366 361
         if (currentState == AwayState.AWAY) {
367 362
             final ServerAwayEvent event = new ServerAwayEvent(owner, reason);
368 363
             final String format = EventUtils.postDisplayable(eventBus, event, "away");
369 364
             owner.doNotification(format, reason);
370
-        } else {
365
+        } else if (oldState != AwayState.UNKNOWN) {
371 366
             final ServerBackEvent event = new ServerBackEvent(owner);
372 367
             final String format = EventUtils.postDisplayable(eventBus, event, "back");
373 368
             owner.doNotification(format);

Loading…
Cancel
Save