mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-03-30 17:45:40 +00:00
no pings in hidden channels
This commit is contained in:
@@ -1659,7 +1659,7 @@ class Guild extends SnowFlake {
|
||||
get mentions() {
|
||||
let mentions = 0;
|
||||
for (const thing of this.channels) {
|
||||
mentions += thing.mentions;
|
||||
if (thing.visible) mentions += thing.mentions;
|
||||
}
|
||||
return mentions;
|
||||
}
|
||||
|
||||
@@ -425,8 +425,6 @@ class Localuser {
|
||||
}
|
||||
|
||||
this.pingEndpoint();
|
||||
|
||||
this.generateFavicon();
|
||||
}
|
||||
inrelation = new Set<User>();
|
||||
outoffocus(): void {
|
||||
@@ -537,7 +535,11 @@ class Localuser {
|
||||
console.log("in here?");
|
||||
returny();
|
||||
}
|
||||
} catch {}
|
||||
} catch (e) {
|
||||
if (!(e instanceof SyntaxError)) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
}
|
||||
@@ -1557,6 +1559,7 @@ class Localuser {
|
||||
async init() {
|
||||
const location = window.location.href.split("/");
|
||||
this.buildservers();
|
||||
this.generateFavicon();
|
||||
if (location[3] === "channels") {
|
||||
const guild = this.loadGuild(location[4]);
|
||||
if (!guild) {
|
||||
|
||||
@@ -932,6 +932,26 @@ class User extends SnowFlake {
|
||||
}
|
||||
|
||||
static async resolve(id: string, localuser: Localuser): Promise<User> {
|
||||
const time = SnowFlake.stringToUnixTime(id);
|
||||
|
||||
if (time < 1420070400000 + 100)
|
||||
return new User(
|
||||
{
|
||||
id: "0",
|
||||
public_flags: 0,
|
||||
username: I18n.friends.notfound(),
|
||||
avatar: null,
|
||||
discriminator: "0000",
|
||||
bio: "",
|
||||
bot: false,
|
||||
premium_type: 0,
|
||||
premium_since: "",
|
||||
accent_color: 0,
|
||||
theme_colors: null,
|
||||
badge_ids: [],
|
||||
},
|
||||
localuser,
|
||||
);
|
||||
let user: User | undefined;
|
||||
if ((user = localuser.userMap.get(id))) return user;
|
||||
const json = await fetch(localuser.info.api.toString() + "/users/" + id + "/profile", {
|
||||
|
||||
Reference in New Issue
Block a user