|
@@ -26,6 +26,7 @@ import com.dmdirc.util.BaseYamlStore;
|
26
|
26
|
|
27
|
27
|
import java.nio.file.Path;
|
28
|
28
|
import java.util.Collection;
|
|
29
|
+import java.util.Collections;
|
29
|
30
|
import java.util.HashMap;
|
30
|
31
|
import java.util.List;
|
31
|
32
|
import java.util.Map;
|
|
@@ -75,8 +76,13 @@ public class YamlProfileStore extends BaseYamlStore<Profile> implements ProfileS
|
75
|
76
|
final String name = requiredString(map, "name");
|
76
|
77
|
final String realname = requiredString(map, "realname");
|
77
|
78
|
final Optional<String> ident = Optional.ofNullable(optionalString(map, "ident"));
|
78
|
|
- final List<String> nicknames = asList(map.get("nicknames"), s -> Optional.of(s.toString()));
|
79
|
|
- return Optional.of(Profile.create(name, realname, ident, nicknames));
|
|
79
|
+ final List<String> nicknames =
|
|
80
|
+ asList(map.get("nicknames"), s -> Optional.of(s.toString()));
|
|
81
|
+ final List<String> highlights =
|
|
82
|
+ map.containsKey("highlights")
|
|
83
|
+ ? asList(map.get("highlights"), s -> Optional.of(s.toString()))
|
|
84
|
+ : Collections.emptyList();
|
|
85
|
+ return Optional.of(Profile.create(name, realname, ident, nicknames, highlights));
|
80
|
86
|
} catch (IllegalArgumentException ex) {
|
81
|
87
|
LOG.info("Unable to read profile", ex);
|
82
|
88
|
return Optional.empty();
|
|
@@ -89,6 +95,7 @@ public class YamlProfileStore extends BaseYamlStore<Profile> implements ProfileS
|
89
|
95
|
map.put("name", object.getName());
|
90
|
96
|
map.put("realname", object.getRealname());
|
91
|
97
|
map.put("nicknames", object.getNicknames().toArray());
|
|
98
|
+ map.put("highlights", object.getHighlights().toArray());
|
92
|
99
|
object.getIdent().ifPresent(v -> map.put("ident", v));
|
93
|
100
|
return map;
|
94
|
101
|
}
|