revolt.js
Advanced tools
Comparing version 6.0.19 to 6.0.20
@@ -234,2 +234,3 @@ import EventEmitter from "eventemitter3"; | ||
} | null | undefined; | ||
server_flags?: number | null | undefined; | ||
channel_id: string; | ||
@@ -236,0 +237,0 @@ channel_name: string; |
@@ -212,2 +212,5 @@ import type { DataEditMessage, DataMessageSend, Embed, Interactions, Masquerade, Message as MessageI, SystemMessage } from "revolt-api"; | ||
id: string; | ||
} | { | ||
type: "Streamable"; | ||
id: string; | ||
} | null | undefined; | ||
@@ -214,0 +217,0 @@ title?: string | null | undefined; |
@@ -426,2 +426,47 @@ "use strict"; | ||
} | ||
case "UserPlatformWipe": { | ||
(0, mobx_1.runInAction)(() => { | ||
var _a; | ||
const user_id = packet.user_id; | ||
(_a = this.client.users.get(user_id)) === null || _a === void 0 ? void 0 : _a.update({ | ||
username: "Removed User", | ||
online: false, | ||
relationship: "None", | ||
flags: packet.flags, | ||
}, [ | ||
"Avatar", | ||
"ProfileBackground", | ||
"ProfileContent", | ||
"StatusPresence", | ||
"StatusText", | ||
]); | ||
const dm_channel = [ | ||
...this.client.channels.values(), | ||
].find((channel) => { | ||
var _a; | ||
return channel.channel_type === | ||
"DirectMessage" && | ||
((_a = channel.recipient_ids) === null || _a === void 0 ? void 0 : _a.includes(user_id)); | ||
}); | ||
if (dm_channel) { | ||
this.client.channels.delete(dm_channel._id); | ||
} | ||
const member_ids = [ | ||
...this.client.members.values(), | ||
] | ||
.filter((member) => member._id.user === user_id) | ||
.map((member) => member._id); | ||
for (const member_id of member_ids) { | ||
this.client.members.deleteKey(member_id); | ||
} | ||
for (const message of [ | ||
...this.client.messages.values(), | ||
].filter((message) => message.author_id === user_id)) { | ||
message.content = "(message withheld)"; | ||
message.attachments = []; | ||
message.embeds = []; | ||
} | ||
}); | ||
break; | ||
} | ||
case "UserUpdate": { | ||
@@ -428,0 +473,0 @@ (_f = this.client.users |
@@ -170,2 +170,6 @@ import type { Emoji, FieldsChannel, FieldsMember, FieldsServer, FieldsUser } from "revolt-api"; | ||
}; | ||
} | { | ||
type: "UserPlatformWipe"; | ||
user_id: string; | ||
flags: number; | ||
} | ({ | ||
@@ -176,3 +180,13 @@ type: "EmojiCreate"; | ||
id: string; | ||
}; | ||
} | ({ | ||
type: "Auth"; | ||
} & ({ | ||
event_type: "DeleteSession"; | ||
user_id: string; | ||
session_id: string; | ||
} | { | ||
event_type: "DeleteAllSessions"; | ||
user_id: string; | ||
exclude_session_id: string; | ||
})); | ||
export {}; |
@@ -234,2 +234,3 @@ import EventEmitter from "eventemitter3"; | ||
} | null | undefined; | ||
server_flags?: number | null | undefined; | ||
channel_id: string; | ||
@@ -236,0 +237,0 @@ channel_name: string; |
@@ -212,2 +212,5 @@ import type { DataEditMessage, DataMessageSend, Embed, Interactions, Masquerade, Message as MessageI, SystemMessage } from "revolt-api"; | ||
id: string; | ||
} | { | ||
type: "Streamable"; | ||
id: string; | ||
} | null | undefined; | ||
@@ -214,0 +217,0 @@ title?: string | null | undefined; |
@@ -420,2 +420,47 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
case "UserPlatformWipe": { | ||
runInAction(() => { | ||
var _a; | ||
const user_id = packet.user_id; | ||
(_a = this.client.users.get(user_id)) === null || _a === void 0 ? void 0 : _a.update({ | ||
username: "Removed User", | ||
online: false, | ||
relationship: "None", | ||
flags: packet.flags, | ||
}, [ | ||
"Avatar", | ||
"ProfileBackground", | ||
"ProfileContent", | ||
"StatusPresence", | ||
"StatusText", | ||
]); | ||
const dm_channel = [ | ||
...this.client.channels.values(), | ||
].find((channel) => { | ||
var _a; | ||
return channel.channel_type === | ||
"DirectMessage" && | ||
((_a = channel.recipient_ids) === null || _a === void 0 ? void 0 : _a.includes(user_id)); | ||
}); | ||
if (dm_channel) { | ||
this.client.channels.delete(dm_channel._id); | ||
} | ||
const member_ids = [ | ||
...this.client.members.values(), | ||
] | ||
.filter((member) => member._id.user === user_id) | ||
.map((member) => member._id); | ||
for (const member_id of member_ids) { | ||
this.client.members.deleteKey(member_id); | ||
} | ||
for (const message of [ | ||
...this.client.messages.values(), | ||
].filter((message) => message.author_id === user_id)) { | ||
message.content = "(message withheld)"; | ||
message.attachments = []; | ||
message.embeds = []; | ||
} | ||
}); | ||
break; | ||
} | ||
case "UserUpdate": { | ||
@@ -422,0 +467,0 @@ (_f = this.client.users |
@@ -170,2 +170,6 @@ import type { Emoji, FieldsChannel, FieldsMember, FieldsServer, FieldsUser } from "revolt-api"; | ||
}; | ||
} | { | ||
type: "UserPlatformWipe"; | ||
user_id: string; | ||
flags: number; | ||
} | ({ | ||
@@ -176,3 +180,13 @@ type: "EmojiCreate"; | ||
id: string; | ||
}; | ||
} | ({ | ||
type: "Auth"; | ||
} & ({ | ||
event_type: "DeleteSession"; | ||
user_id: string; | ||
session_id: string; | ||
} | { | ||
event_type: "DeleteAllSessions"; | ||
user_id: string; | ||
exclude_session_id: string; | ||
})); | ||
export {}; |
{ | ||
"name": "revolt.js", | ||
"version": "6.0.19", | ||
"version": "6.0.20", | ||
"main": "dist/index.js", | ||
@@ -20,3 +20,3 @@ "typings": "dist/index.d.ts", | ||
"mobx": "^6.3.2", | ||
"revolt-api": "0.5.5-5", | ||
"revolt-api": "0.5.7", | ||
"ulid": "^2.3.0", | ||
@@ -23,0 +23,0 @@ "ws": "^8.2.2" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
505505
14000
+ Addedrevolt-api@0.5.7(transitive)
- Removedrevolt-api@0.5.5-5(transitive)
Updatedrevolt-api@0.5.7