move applyUserTrustLevel() to API.*

This commit is contained in:
pypy
2020-01-12 19:48:31 +09:00
parent 3bec2798ac
commit 293fe6c552
+5 -5
View File
@@ -797,7 +797,7 @@ CefSharp.BindObjectAsync(
}); });
}; };
var applyUserTrustLevel = function (ref) { API.applyUserTrustLevel = function (ref) {
ref.$isModerator = ref.developerType && ref.$isModerator = ref.developerType &&
ref.developerType !== 'none'; ref.developerType !== 'none';
ref.$isTroll = false; ref.$isTroll = false;
@@ -847,7 +847,7 @@ CefSharp.BindObjectAsync(
if (ref.homeLocation !== ref.$homeLocation.tag) { if (ref.homeLocation !== ref.$homeLocation.tag) {
ref.$homeLocation = this.parseLocation(ref.homeLocation); ref.$homeLocation = this.parseLocation(ref.homeLocation);
} }
applyUserTrustLevel(ref); this.applyUserTrustLevel(ref);
} else { } else {
ref = { ref = {
id: '', id: '',
@@ -884,7 +884,7 @@ CefSharp.BindObjectAsync(
...json ...json
}; };
ref.$homeLocation = this.parseLocation(ref.homeLocation); ref.$homeLocation = this.parseLocation(ref.homeLocation);
applyUserTrustLevel(ref); this.applyUserTrustLevel(ref);
this.currentUser = ref; this.currentUser = ref;
this.isLoggedIn = true; this.isLoggedIn = true;
this.$emit('LOGIN', { this.$emit('LOGIN', {
@@ -964,7 +964,7 @@ CefSharp.BindObjectAsync(
...json ...json
}; };
ref.$location = this.parseLocation(ref.location); ref.$location = this.parseLocation(ref.location);
applyUserTrustLevel(ref); this.applyUserTrustLevel(ref);
this.cachedUsers.set(ref.id, ref); this.cachedUsers.set(ref.id, ref);
} else { } else {
var props = {}; var props = {};
@@ -978,7 +978,7 @@ CefSharp.BindObjectAsync(
if (ref.location !== ref.$location.tag) { if (ref.location !== ref.$location.tag) {
ref.$location = this.parseLocation(ref.location); ref.$location = this.parseLocation(ref.location);
} }
applyUserTrustLevel(ref); this.applyUserTrustLevel(ref);
for (var prop in ref) { for (var prop in ref) {
if (isObject(ref[prop]) === false) { if (isObject(ref[prop]) === false) {
props[prop] = true; props[prop] = true;