mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-13 07:29:30 +01:00
channel: Don't send TOPIC on entirely new channel
This commit is contained in:
parent
2759d8f5d3
commit
79de443496
@ -272,6 +272,7 @@ func (channel *Channel) Join(client *Client, key string) {
|
|||||||
channel.members.Add(client)
|
channel.members.Add(client)
|
||||||
|
|
||||||
// give channel mode if necessary
|
// give channel mode if necessary
|
||||||
|
var newChannel bool
|
||||||
var givenMode *Mode
|
var givenMode *Mode
|
||||||
client.server.registeredChannelsMutex.Lock()
|
client.server.registeredChannelsMutex.Lock()
|
||||||
defer client.server.registeredChannelsMutex.Unlock()
|
defer client.server.registeredChannelsMutex.Unlock()
|
||||||
@ -283,6 +284,7 @@ func (channel *Channel) Join(client *Client, key string) {
|
|||||||
channel.createdTime = time.Now()
|
channel.createdTime = time.Now()
|
||||||
channel.members[client][ChannelOperator] = true
|
channel.members[client][ChannelOperator] = true
|
||||||
givenMode = &ChannelOperator
|
givenMode = &ChannelOperator
|
||||||
|
newChannel = true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// we should only do this on registered channels
|
// we should only do this on registered channels
|
||||||
@ -316,7 +318,10 @@ func (channel *Channel) Join(client *Client, key string) {
|
|||||||
} else {
|
} else {
|
||||||
client.Send(nil, client.nickMaskString, "JOIN", channel.name)
|
client.Send(nil, client.nickMaskString, "JOIN", channel.name)
|
||||||
}
|
}
|
||||||
channel.getTopicNoMutex(client) // we already have Lock
|
// don't sent topic when it's an entirely new channel
|
||||||
|
if !newChannel {
|
||||||
|
channel.getTopicNoMutex(client) // we already have Lock
|
||||||
|
}
|
||||||
channel.namesNoMutex(client)
|
channel.namesNoMutex(client)
|
||||||
if givenMode != nil {
|
if givenMode != nil {
|
||||||
for member := range channel.members {
|
for member := range channel.members {
|
||||||
|
Loading…
Reference in New Issue
Block a user