87 lines
3.1 KiB
TypeScript
87 lines
3.1 KiB
TypeScript
// Metro module 12376 (f12377).
|
|
import UserStore from "../../../stores/UserStore";
|
|
import { ActivityActionTypes } from "../../../Constants";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import RequestToStream_messages from "../../request_to_stream/RequestToStream.messages";
|
|
import { getName } from "../../../utils/NicknameUtils";
|
|
const getAskToJoinText = function getAskToJoinText(a0, a1, a2, a3, a4) {
|
|
if (a0.author.id === a3) {
|
|
if (a2.isPrivate()) {
|
|
const user = UserStore.getUser(a2.getRecipientId());
|
|
if (user != null) {
|
|
return a4 ? intl.formatToPlainString(t.JddpN2, {
|
|
username: user.globalName,
|
|
appName: a1
|
|
}) : intl.formatToPlainString(t.gYVkSW, {
|
|
username: user.globalName,
|
|
appName: a1
|
|
});
|
|
}
|
|
}
|
|
return a4 ? intl.formatToPlainString(t["2N1kNS"], {
|
|
appName: a1
|
|
}) : intl.formatToPlainString(t.IA6uDV, {
|
|
appName: a1
|
|
});
|
|
}
|
|
return a4 ? intl.formatToPlainString(t.XE8axA, {
|
|
username: a0.author.globalName,
|
|
appName: a1
|
|
}) : intl.formatToPlainString(t.hgcjOn, {
|
|
username: a0.author.globalName,
|
|
appName: a1
|
|
});
|
|
};
|
|
export function getHeaderText(a0, a1, a2) {
|
|
if (ActivityActionTypes.LISTEN === a1) {
|
|
return intl.formatToPlainString(t["/8czH4"], {
|
|
name: a0
|
|
});
|
|
}
|
|
if (ActivityActionTypes.WATCH === a1) {
|
|
return intl.formatToPlainString(t.BBJXVk, {
|
|
name: a0
|
|
});
|
|
}
|
|
if (ActivityActionTypes.JOIN === a1) {
|
|
return a2 ? void 0 : intl.string(t.pkq6Vq);
|
|
}
|
|
if (ActivityActionTypes.STREAM_REQUEST === a1) {
|
|
return intl.string(RequestToStream_messages.DKHhec);
|
|
}
|
|
ActivityActionTypes.JOIN_REQUEST;
|
|
return intl.string(t.Ckxb6j);
|
|
}
|
|
export function getRequestToStreamText(a0, a1, a2) {
|
|
return a0.author.id === a2 ? intl.string(RequestToStream_messages["8B3U5O"]) : intl.formatToPlainString(RequestToStream_messages["d/qbC0"], {
|
|
username: getName(a1.guild_id, a1.id, a0.author)
|
|
});
|
|
}
|
|
export { getAskToJoinText };
|
|
export function getDeadGameInviteText(a0, a1, a2, a3, a4) {
|
|
const type = a0.activity?.type;
|
|
if (ActivityActionTypes.LISTEN !== type && ActivityActionTypes.WATCH !== type && ActivityActionTypes.JOIN !== type) {
|
|
if (ActivityActionTypes.STREAM_REQUEST === type) {
|
|
return a0.author.id === a3 ? intl.string(RequestToStream_messages["8B3U5O"]) : intl.formatToPlainString(RequestToStream_messages["d/qbC0"], {
|
|
username: getName(a2.guild_id, a2.id, a0.author)
|
|
});
|
|
}
|
|
ActivityActionTypes.JOIN_REQUEST;
|
|
return getAskToJoinText(a0, a1, a2, a3, true);
|
|
}
|
|
return intl.string(a4 ? t.x1UXGR : t["Ek+51n"]);
|
|
}
|
|
export function getPartyText({ activityActionType, maxPartySize, partySize }) {
|
|
return activityActionType !== ActivityActionTypes.STREAM_REQUEST ? activityActionType === ActivityActionTypes.LISTEN ? maxPartySize > 0 ? intl.formatToPlainString(t.Zogoou, {
|
|
partySize,
|
|
maxPartySize
|
|
}) : intl.formatToPlainString(t.UGei0j, {
|
|
partySize
|
|
}) : maxPartySize > 0 ? intl.formatToPlainString(t.gLu7NU, {
|
|
partySize,
|
|
maxPartySize
|
|
}) : intl.formatToPlainString(t["65JnWC"], {
|
|
partySize
|
|
}) : "";
|
|
}
|