Browse Source

Add a display property for linking to users.

Issue #424
pull/747/head
Chris Smith 7 years ago
parent
commit
407d8b00fa

+ 4
- 1
api/src/main/java/com/dmdirc/events/DisplayProperty.java View File

22
 
22
 
23
 package com.dmdirc.events;
23
 package com.dmdirc.events;
24
 
24
 
25
+import com.dmdirc.interfaces.User;
25
 import com.dmdirc.util.colours.Colour;
26
 import com.dmdirc.util.colours.Colour;
26
 
27
 
27
 /**
28
 /**
28
- * Describes a property that may be set on a {@link DisplayableEvent} to affect its display.
29
+ * Describes a property that may be set on a {@link com.dmdirc.interfaces.Displayable} to affect its display.
29
  */
30
  */
30
 @SuppressWarnings("UnusedDeclaration") // Generic type used for compile-time validation only
31
 @SuppressWarnings("UnusedDeclaration") // Generic type used for compile-time validation only
31
 public interface DisplayProperty<T> {
32
 public interface DisplayProperty<T> {
38
     DisplayProperty<Boolean> DO_NOT_DISPLAY = new DisplayPropertyImpl<>();
39
     DisplayProperty<Boolean> DO_NOT_DISPLAY = new DisplayPropertyImpl<>();
39
     /** Whether to suppress timestamps for the event. */
40
     /** Whether to suppress timestamps for the event. */
40
     DisplayProperty<Boolean> NO_TIMESTAMPS = new DisplayPropertyImpl<>();
41
     DisplayProperty<Boolean> NO_TIMESTAMPS = new DisplayPropertyImpl<>();
42
+    /** A user that the displayable is linked to. */
43
+    DisplayProperty<User> LINK_USER = new DisplayPropertyImpl<>();
41
 
44
 
42
     final class DisplayPropertyImpl<T> implements DisplayProperty<T> {}
45
     final class DisplayPropertyImpl<T> implements DisplayProperty<T> {}
43
 
46
 

+ 1
- 0
src/main/java/com/dmdirc/ChannelClient.java View File

48
         this.groupChat = groupChat;
48
         this.groupChat = groupChat;
49
         this.clientInfo = clientInfo;
49
         this.clientInfo = clientInfo;
50
         properties = new DisplayPropertyMap();
50
         properties = new DisplayPropertyMap();
51
+        properties.put(DisplayProperty.LINK_USER, user);
51
     }
52
     }
52
 
53
 
53
     @Override
54
     @Override

Loading…
Cancel
Save