in src/main/java/com/googlesource/gerrit/plugins/emoticons/GetPreference.java [58:76]
public ConfigInfo apply(AccountResource rsrc) throws AuthException, PermissionBackendException {
if (self.get() != rsrc.getUser()) {
permissionBackend.currentUser().check(ADMINISTRATE_SERVER);
}
ConfigInfo globalCfg = getConfig.get().apply(new ConfigResource());
Config db = projectCache.getAllProjects().getConfig(pluginName + ".config").get();
ConfigInfo info = new ConfigInfo();
info.showEmoticons =
db.getBoolean(
PREFERENCE,
self.get().getUserName().orElse(null),
KEY_SHOW_EMOTICONS,
(globalCfg.showEmoticons != null ? globalCfg.showEmoticons : true));
if (!info.showEmoticons) {
info.showEmoticons = null;
}
return info;
}