Quellcode durchsuchen

Add a display property for linking to users.

Issue #424
pull/747/head
Chris Smith vor 7 Jahren
Ursprung
Commit
407d8b00fa

+ 4
- 1
api/src/main/java/com/dmdirc/events/DisplayProperty.java Datei anzeigen

@@ -22,10 +22,11 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
+import com.dmdirc.interfaces.User;
25 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 31
 @SuppressWarnings("UnusedDeclaration") // Generic type used for compile-time validation only
31 32
 public interface DisplayProperty<T> {
@@ -38,6 +39,8 @@ public interface DisplayProperty<T> {
38 39
     DisplayProperty<Boolean> DO_NOT_DISPLAY = new DisplayPropertyImpl<>();
39 40
     /** Whether to suppress timestamps for the event. */
40 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 45
     final class DisplayPropertyImpl<T> implements DisplayProperty<T> {}
43 46
 

+ 1
- 0
src/main/java/com/dmdirc/ChannelClient.java Datei anzeigen

@@ -48,6 +48,7 @@ public class ChannelClient implements GroupChatUser {
48 48
         this.groupChat = groupChat;
49 49
         this.clientInfo = clientInfo;
50 50
         properties = new DisplayPropertyMap();
51
+        properties.put(DisplayProperty.LINK_USER, user);
51 52
     }
52 53
 
53 54
     @Override

Laden…
Abbrechen
Speichern