mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
parent
0f5603eca2
commit
4dcbc48159
16 changed files with 660 additions and 3 deletions
|
|
@ -55,6 +55,7 @@ type Channel struct {
|
|||
dirtyBits uint
|
||||
settings ChannelSettings
|
||||
uuid utils.UUID
|
||||
metadata map[string]string
|
||||
// these caches are paired to allow iteration over channel members without holding the lock
|
||||
membersCache []*Client
|
||||
memberDataCache []*memberData
|
||||
|
|
@ -126,6 +127,7 @@ func (channel *Channel) applyRegInfo(chanReg RegisteredChannel) {
|
|||
channel.userLimit = chanReg.UserLimit
|
||||
channel.settings = chanReg.Settings
|
||||
channel.forward = chanReg.Forward
|
||||
channel.metadata = chanReg.Metadata
|
||||
|
||||
for _, mode := range chanReg.Modes {
|
||||
channel.flags.SetMode(mode, true)
|
||||
|
|
@ -163,6 +165,7 @@ func (channel *Channel) ExportRegistration() (info RegisteredChannel) {
|
|||
info.AccountToUMode = maps.Clone(channel.accountToUMode)
|
||||
|
||||
info.Settings = channel.settings
|
||||
info.Metadata = channel.metadata
|
||||
|
||||
return
|
||||
}
|
||||
|
|
@ -892,6 +895,10 @@ func (channel *Channel) Join(client *Client, key string, isSajoin bool, rb *Resp
|
|||
rb.Add(nil, client.server.name, "MARKREAD", chname, client.GetReadMarker(chcfname))
|
||||
}
|
||||
|
||||
if rb.session.capabilities.Has(caps.Metadata) {
|
||||
syncChannelMetadata(client.server, rb, channel)
|
||||
}
|
||||
|
||||
if rb.session.client == client {
|
||||
// don't send topic and names for a SAJOIN of a different client
|
||||
channel.SendTopic(client, rb, false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue