decord/source/modules/notification_center/getNotificationCenterItemBody.tsx

234 lines
8 KiB
TypeScript
Raw Normal View History

// Module ID: 16348
// Function ID: 16349
2026-07-29 08:29:29 +00:00
// Name: getNotificationCenterItemBody
// Dependencies: [7459, 1908, 4130, 1921, 673, 1233, 4325, 7573, 1901, 38, 2]
2026-08-26 06:04:24 +00:00
// Exports: default, getFriendRequestSentBody
2026-07-20 16:05:17 +00:00
// Module 16348 (getNotificationCenterItemBody)
2026-09-02 09:53:35 +00:00
import getSystemLocale from "getSystemLocale" /* 1233 */;
import closure_3 from "scheduledEventSort" /* 7459 */;
import { isGuildEventEnded } from "scheduledEventSort" /* 7459 */;
2026-09-02 09:53:35 +00:00
import closure_5 from "createGuildRecordFromRust" /* 1908 */;
2026-09-01 10:26:29 +00:00
import closure_6 from "markAllUserIdListsStale" /* 4130 */;
2026-09-02 09:53:35 +00:00
import closure_7 from "mergeGuildAvatar" /* 1921 */;
import ME from "ME" /* 673 */;
2026-07-23 10:11:24 +00:00
2026-08-26 06:04:24 +00:00
require = arg1;
2026-08-24 06:08:38 +00:00
({ EMPTY_STRING_SNOWFLAKE_ID: closure_8, RelationshipTypes: c9 } = ME);
const result = require("set").fileFinishedImporting("modules/notification_center/getNotificationCenterItemBody.tsx");
2026-07-20 16:05:17 +00:00
export default function getNotificationCenterItemBody(arg0) {
({ item, renderApplication } = arg0);
2026-07-29 08:29:29 +00:00
let applicationId = renderApplication;
renderApplication = undefined;
2026-07-20 16:05:17 +00:00
const other_user = item.other_user;
let id;
2026-07-29 08:29:29 +00:00
if (other_user != null) {
2026-07-20 16:05:17 +00:00
id = other_user.id;
}
2026-07-29 08:29:29 +00:00
if (id == null) {
2026-07-20 16:05:17 +00:00
id = closure_8;
}
let obj = renderApplication(4325);
2026-08-24 06:08:38 +00:00
obj1 = user;
2026-07-20 16:05:17 +00:00
const other_user2 = item.other_user;
let id1;
2026-07-29 08:29:29 +00:00
if (other_user2 != null) {
2026-07-20 16:05:17 +00:00
id1 = other_user2.id;
}
2026-08-26 06:04:24 +00:00
let name = obj.getName(user.getUser(id1));
2026-07-23 10:11:24 +00:00
applicationId = item.applicationId;
2026-07-29 08:29:29 +00:00
renderApplication = applicationId;
2026-07-20 16:05:17 +00:00
const type = item.type;
if (applicationId(7573).NotificationCenterLocalItems.FRIEND_REQUESTS_GROUPED === type) {
let tmp2Result = tmp2(4325);
2026-07-20 16:05:17 +00:00
let other_users = item.other_users;
let id2;
2026-07-29 08:29:29 +00:00
if (other_users != null) {
2026-07-20 16:05:17 +00:00
const first = other_users[0];
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-20 16:05:17 +00:00
id2 = first.id;
}
}
2026-08-26 06:04:24 +00:00
const name1 = tmp2Result.getName(obj1.getUser(id2));
tmp2Result = tmp2(4325);
2026-07-20 16:05:17 +00:00
const other_users2 = item.other_users;
let id3;
2026-07-29 08:29:29 +00:00
if (other_users2 != null) {
if (other_users2[1] != null) {
2026-08-26 06:04:24 +00:00
id3 = tmp37.id;
2026-07-20 16:05:17 +00:00
}
}
other_users = item.other_users;
2026-07-29 08:29:29 +00:00
let num;
2026-08-26 06:04:24 +00:00
const name2 = tmp2Result.getName(obj1.getUser(id3));
2026-07-29 08:29:29 +00:00
if (other_users != null) {
num = other_users.length;
}
if (num == null) {
num = 0;
}
const bound = Math.max(num - 2, 0);
2026-09-02 09:53:35 +00:00
const intl12 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
obj = { user: null, user2: null, count: null };
2026-08-26 06:04:24 +00:00
obj[0] = name1;
obj[1] = name2;
2026-07-29 08:29:29 +00:00
obj[2] = bound;
2026-09-02 09:53:35 +00:00
return intl12.format(tmp6(1233).t.g5xyIC, obj);
} else if (tmp6(7573).NotificationCenterLocalItems.MOBILE_NATIVE_UPDATE_AVAILABLE === type) {
2026-08-26 06:04:24 +00:00
let str7;
2026-07-29 08:29:29 +00:00
if (item.local_id != null) {
2026-08-26 06:04:24 +00:00
const parts = str6.split("_");
str7 = parts.pop();
2026-07-29 08:29:29 +00:00
}
2026-08-26 06:04:24 +00:00
if (str7 == null) {
str7 = "unknown";
2026-07-20 16:05:17 +00:00
}
const _HermesInternal3 = HermesInternal;
2026-08-26 06:04:24 +00:00
return "Update to build " + str7 + " available!";
} else if (tmp6(7573).NotificationCenterItems.FRIEND_SUGGESTION_CREATED === type) {
2026-07-20 16:05:17 +00:00
if (relationshipType.getRelationshipType(id) === constants.PENDING_OUTGOING) {
2026-09-02 09:53:35 +00:00
const intl11 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
obj = { user: null };
2026-08-26 06:04:24 +00:00
obj[0] = name;
2026-09-02 09:53:35 +00:00
let str5 = intl11.format(tmp6(1233).t.gZVTy2, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-08-26 06:04:24 +00:00
str5 = item.body;
if (str5 == null) {
str5 = "";
2026-07-20 16:05:17 +00:00
}
}
2026-08-26 06:04:24 +00:00
return str5;
} else if (tmp6(7573).NotificationCenterItems.GUILD_SCHEDULED_EVENT_STARTED === type) {
2026-07-20 16:05:17 +00:00
const guild_scheduled_event_id = item.guild_scheduled_event_id;
let guildScheduledEvent = null;
if (null != guild_scheduled_event_id) {
guildScheduledEvent = guildScheduledEvent.getGuildScheduledEvent(guild_scheduled_event_id);
}
2026-08-26 06:04:24 +00:00
if (guildScheduledEvent != null) {
name = guildScheduledEvent.name;
}
2026-07-20 16:05:17 +00:00
let guild_id;
2026-07-29 08:29:29 +00:00
if (guildScheduledEvent != null) {
2026-07-20 16:05:17 +00:00
guild_id = guildScheduledEvent.guild_id;
}
2026-07-23 10:11:24 +00:00
guild = guild.getGuild(guild_id);
2026-08-26 06:04:24 +00:00
let name3;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-08-26 06:04:24 +00:00
name3 = guild.name;
}
2026-09-02 09:53:35 +00:00
let tmp6Result = tmp6(1901);
2026-08-26 06:04:24 +00:00
if (!tmp6Result.isNullOrEmpty(name3)) {
2026-09-02 09:53:35 +00:00
tmp6Result = tmp6(1901);
2026-08-26 06:04:24 +00:00
if (!tmp6Result.isNullOrEmpty(name)) {
if (tmp27Result) {
2026-09-02 09:53:35 +00:00
const intl10 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
obj1 = { event_name: null, guild_name: null };
2026-08-26 06:04:24 +00:00
obj1[0] = name;
obj1[1] = name3;
2026-09-02 09:53:35 +00:00
let formatResult = intl10.format(tmp6(1233).t.AyvfXR, obj1);
2026-07-20 16:05:17 +00:00
}
return formatResult;
}
2026-07-29 08:29:29 +00:00
}
2026-08-26 06:04:24 +00:00
let str4 = item.body;
if (str4 == null) {
str4 = "";
2026-07-29 08:29:29 +00:00
}
2026-08-26 06:04:24 +00:00
formatResult = str4;
const tmp27 = isGuildEventEnded;
tmp27Result = isGuildEventEnded(guildScheduledEvent);
} else if (tmp6(7573).NotificationCenterLocalItems.INCOMING_FRIEND_REQUESTS === type) {
2026-07-29 08:29:29 +00:00
if (null != applicationId) {
2026-09-02 09:53:35 +00:00
const intl9 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
const obj2 = { username: null, applicationName: null };
2026-08-26 06:04:24 +00:00
obj2[0] = name;
2026-07-29 08:29:29 +00:00
obj2[1] = function applicationName() {
return renderApplication(applicationId);
};
2026-09-02 09:53:35 +00:00
let formatResult1 = intl9.format(tmp6(1233).t["9Dgf1L"], obj2);
2026-07-29 08:29:29 +00:00
} else {
2026-09-02 09:53:35 +00:00
const intl8 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
const obj3 = { username: null };
2026-08-26 06:04:24 +00:00
obj3[0] = name;
formatResult1 = intl8.format(tmp19, obj3);
2026-07-29 08:29:29 +00:00
}
return formatResult1;
} else if (tmp6(7573).NotificationCenterLocalItems.INCOMING_FRIEND_REQUESTS_ACCEPTED === type) {
2026-07-29 08:29:29 +00:00
if (null != applicationId) {
2026-09-02 09:53:35 +00:00
const intl7 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
const obj4 = { username: null, applicationName: null };
2026-08-26 06:04:24 +00:00
obj4[0] = name;
2026-07-29 08:29:29 +00:00
obj4[1] = function applicationName() {
return renderApplication(applicationId);
};
2026-09-02 09:53:35 +00:00
let formatResult2 = intl7.format(tmp6(1233).t.nnC1q9, obj4);
2026-07-29 08:29:29 +00:00
} else {
2026-09-02 09:53:35 +00:00
const intl6 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
const obj5 = { username: null };
2026-08-26 06:04:24 +00:00
obj5[0] = name;
formatResult2 = intl6.format(tmp17, obj5);
2026-07-29 08:29:29 +00:00
}
return formatResult2;
} else if (tmp6(7573).NotificationCenterItems.FRIEND_REQUEST_ACCEPTED === type) {
2026-07-29 08:29:29 +00:00
if (null != applicationId) {
2026-09-02 09:53:35 +00:00
const intl5 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
const obj6 = { username: null, applicationName: null };
2026-08-26 06:04:24 +00:00
obj6[0] = name;
2026-07-29 08:29:29 +00:00
obj6[1] = function applicationName() {
return renderApplication(applicationId);
};
2026-09-02 09:53:35 +00:00
let formatResult3 = intl5.format(tmp6(1233).t.jXlYiF, obj6);
2026-07-29 08:29:29 +00:00
} else {
2026-09-02 09:53:35 +00:00
const intl4 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
const obj7 = { username: null };
2026-08-26 06:04:24 +00:00
obj7[0] = name;
formatResult3 = intl4.format(tmp15, obj7);
2026-07-29 08:29:29 +00:00
}
return formatResult3;
} else if (tmp6(7573).NotificationCenterLocalItems.INCOMING_GAME_FRIEND_REQUESTS_ACCEPTED === type) {
2026-07-20 16:05:17 +00:00
const _HermesInternal2 = HermesInternal;
2026-07-29 08:29:29 +00:00
tmp2(38)(null != applicationId, "Expected application id for " + item.type);
2026-09-02 09:53:35 +00:00
const intl3 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
const obj8 = { username: null, applicationName: null };
2026-08-26 06:04:24 +00:00
obj8[0] = name;
2026-07-29 08:29:29 +00:00
obj8[1] = function applicationName() {
return applicationId(renderApplication);
2026-07-20 16:05:17 +00:00
};
2026-09-02 09:53:35 +00:00
return intl3.format(tmp6(1233).t["BB/0vn"], obj8);
} else if (tmp6(7573).NotificationCenterLocalItems.INCOMING_GAME_FRIEND_REQUESTS === type) {
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
tmp2(38)(null != applicationId, "Expected application id for " + item.type);
2026-09-02 09:53:35 +00:00
const intl2 = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
const obj9 = { username: null, applicationName: null };
2026-08-26 06:04:24 +00:00
obj9[0] = name;
2026-07-29 08:29:29 +00:00
obj9[1] = function applicationName() {
return applicationId(renderApplication);
2026-07-20 16:05:17 +00:00
};
2026-09-02 09:53:35 +00:00
return intl2.format(tmp6(1233).t["7cqOLI"], obj9);
} else if (tmp6(7573).NotificationCenterItems.GAME_FRIEND_REQUEST_ACCEPTED === type) {
2026-07-20 16:05:17 +00:00
if (null == applicationId) {
2026-07-29 08:29:29 +00:00
let body = item.body;
2026-07-20 16:05:17 +00:00
} else {
2026-09-02 09:53:35 +00:00
const intl = tmp6(1233).intl;
2026-07-29 08:29:29 +00:00
const obj10 = { username: null, applicationName: null };
2026-08-26 06:04:24 +00:00
obj10[0] = name;
2026-07-29 08:29:29 +00:00
obj10[1] = function applicationName() {
return applicationId(renderApplication);
2026-07-20 16:05:17 +00:00
};
2026-09-02 09:53:35 +00:00
body = intl.format(tmp6(1233).t.Wi64vN, obj10);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return body;
2026-07-20 16:05:17 +00:00
} else {
2026-08-26 06:04:24 +00:00
let str = item.body;
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-08-26 06:04:24 +00:00
return str;
2026-07-20 16:05:17 +00:00
}
};
2026-08-26 06:04:24 +00:00
export const getFriendRequestSentBody = function getFriendRequestSentBody(user) {
const intl = getSystemLocale.intl;
return intl.format(getSystemLocale.t.gZVTy2, { user });
};