返回提交历史
Modified
src/controllers/api/addPendingFriendController.ts
+2
-1
Modified
src/controllers/api/removeFriendController.ts
+2
-1
Modified
src/services/friendService.ts
+2
-1
XFEstudio/XFESpaceNinjaServer
fix: add unicode platform suffix to friend display names (#3528)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3528 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
316d73b5
代码差异
3 个文件
+6
-3
@@ -59,9 +59,10 @@ const sendFriendRequest = async (
59
59
return;
60
60
}
61
61
62
const platformId = 0; // TODO
62
63
const friendInfo: IFriendInfo = {
63
64
_id: toOid(account._id),
64
DisplayName: account.DisplayName,
65
DisplayName: account.DisplayName + String.fromCharCode(0xe000 + platformId),
65
66
LastLogin: toMongoDate(account.LastLogin),
66
67
Note: message
67
68
};
@@ -111,7 +111,8 @@ const toRemoveFriendsResponse = async (
111
111
for (const friend of friends) {
112
112
const acct = await Account.findById(friend.$oid, "DisplayName");
113
113
if (acct) {
114
response.FriendNames.push(acct.DisplayName);
114
const platformId = 0; // TODO
115
response.FriendNames.push(acct.DisplayName + String.fromCharCode(0xe000 + platformId));
115
116
}
116
117
}
117
118
return response;
@@ -7,7 +7,8 @@ import { fromOid, toMongoDate } from "../helpers/inventoryHelpers.ts";
7
7
8
8
export const addAccountDataToFriendInfo = async (info: IFriendInfo): Promise<void> => {
9
9
const account = (await Account.findById(fromOid(info._id), "DisplayName LastLogin"))!;
10
info.DisplayName = account.DisplayName;
10
const platformId = 0; // TODO
11
info.DisplayName = account.DisplayName + String.fromCharCode(0xe000 + platformId);
11
12
info.LastLogin = toMongoDate(account.LastLogin);
12
13
};
13
14