Add nsfw flag on guild channel records
Persist age-restricted channel marking for sidebar badges and P2P gossip sync. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -33,7 +33,7 @@ Create and load guilds in local storage, join peers on `pearcord:guild:{guildId}
|
||||
| `PearcordGuild#reorderChannelsInParent` | Reassign `position` for siblings under one category/root |
|
||||
| `PearcordGuild#moveChannelToParent` | Move channel into category (v0.8.168) |
|
||||
| `PearcordGuild#reorderCategories` | Reassign `position` for category rows |
|
||||
| `PearcordGuild#updateChannel`, `#ingestChannel` | Upsert + thread meta; voice/stage channels support optional `userLimit` (0–99, v0.8.172) |
|
||||
| `PearcordGuild#updateChannel`, `#ingestChannel` | Upsert + thread meta; voice/stage `userLimit` (0–99); `nsfw` flag (v0.8.173) |
|
||||
| `PearcordGuild#setMessageHandler(fn)` | Inbound `RPC.MESSAGE_CREATE` persistence hook (platform sets this) |
|
||||
| `PearcordGuild#gossip*` / `#sendVoiceMedia` / `#sendScreenMedia` | Outbound RPC (see `index.js` for full list) |
|
||||
| `PearcordGuild#simulateGossip(method, payload)` | Bare smoke injection without live peers |
|
||||
|
||||
@@ -104,7 +104,8 @@ class PearcordGuild extends EventEmitter {
|
||||
userLimit:
|
||||
type === CHANNEL_TYPES.VOICE || type === CHANNEL_TYPES.STAGE
|
||||
? Math.max(0, Math.min(99, Number(extra.userLimit) || 0))
|
||||
: 0
|
||||
: 0,
|
||||
nsfw: !!extra.nsfw
|
||||
}
|
||||
await this.db.insert(COLLECTIONS.CHANNELS, channel)
|
||||
if (type === CHANNEL_TYPES.THREAD && extra.rootMessageId) {
|
||||
@@ -1057,7 +1058,8 @@ class PearcordGuild extends EventEmitter {
|
||||
topic: channel.topic ?? null,
|
||||
userLimit: channel.userLimit !== undefined
|
||||
? Math.max(0, Math.min(99, Number(channel.userLimit) || 0))
|
||||
: Math.max(0, Math.min(99, Number(prev?.userLimit) || 0))
|
||||
: Math.max(0, Math.min(99, Number(prev?.userLimit) || 0)),
|
||||
nsfw: channel.nsfw !== undefined ? !!channel.nsfw : !!prev?.nsfw
|
||||
}
|
||||
await this.db.insert(COLLECTIONS.CHANNELS, base)
|
||||
if (channel.type === CHANNEL_TYPES.THREAD) {
|
||||
|
||||
Reference in New Issue
Block a user