|
@@ -25,7 +25,6 @@ package com.dmdirc.ui.messages;
|
25
|
25
|
import com.dmdirc.DMDircMBassador;
|
26
|
26
|
import com.dmdirc.FrameContainer;
|
27
|
27
|
import com.dmdirc.config.ConfigBinding;
|
28
|
|
-import com.dmdirc.events.DisplayProperty;
|
29
|
28
|
import com.dmdirc.events.DisplayableEvent;
|
30
|
29
|
import com.dmdirc.interfaces.config.AggregateConfigProvider;
|
31
|
30
|
|
|
@@ -41,6 +40,7 @@ public class BackBuffer {
|
41
|
40
|
private final DMDircMBassador eventBus;
|
42
|
41
|
private final EventFormatter formatter;
|
43
|
42
|
private final AggregateConfigProvider configProvider;
|
|
43
|
+ private final FrameContainer owner;
|
44
|
44
|
|
45
|
45
|
@ConfigBinding(domain="dev", key="enableNewEvents")
|
46
|
46
|
private boolean enabled;
|
|
@@ -49,6 +49,7 @@ public class BackBuffer {
|
49
|
49
|
final FrameContainer owner,
|
50
|
50
|
final ColourManagerFactory colourManagerFactory,
|
51
|
51
|
final EventFormatter formatter) {
|
|
52
|
+ this.owner = owner;
|
52
|
53
|
this.styliser = new Styliser(
|
53
|
54
|
owner.getConnection().orElse(null),
|
54
|
55
|
owner.getConfigManager(),
|
|
@@ -82,10 +83,9 @@ public class BackBuffer {
|
82
|
83
|
*/
|
83
|
84
|
@Handler
|
84
|
85
|
public void handleDisplayableEvent(final DisplayableEvent event) {
|
85
|
|
- if (enabled && !event.getDisplayProperty(DisplayProperty.HANDLED).isPresent()) {
|
|
86
|
+ if (enabled && event.getSource().equals(owner)) {
|
86
|
87
|
formatter.format(event).ifPresent(
|
87
|
88
|
t -> document.addText(event.getTimestamp(), event.getDisplayProperties(), t));
|
88
|
|
- event.setDisplayProperty(DisplayProperty.HANDLED, Boolean.TRUE);
|
89
|
89
|
}
|
90
|
90
|
}
|
91
|
91
|
|