1
0
Fork 0
forked from External/ergo

Merge pull request #1496 from slingamn/jointime.1

fix #1490
This commit is contained in:
Shivaram Lingamneni 2021-01-21 01:20:45 -05:00 committed by GitHub
commit 2e7cf3cc1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 274 additions and 92 deletions

View file

@ -985,8 +985,8 @@ func extjwtHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
claims["channel"] = channel.Name()
claims["joined"] = 0
claims["cmodes"] = []string{}
if present, cModes := channel.ClientStatus(client); present {
claims["joined"] = 1
if present, joinTimeSecs, cModes := channel.ClientStatus(client); present {
claims["joined"] = joinTimeSecs
var modeStrings []string
for _, cMode := range cModes {
modeStrings = append(modeStrings, string(cMode))
@ -2660,7 +2660,7 @@ func renameHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
}
config := server.Config()
status, _ := channel.historyStatus(config)
status, _, _ := channel.historyStatus(config)
if status == HistoryPersistent {
rb.Add(nil, server.name, "FAIL", "RENAME", "CANNOT_RENAME", oldName, utils.SafeErrorParam(newName), client.t("Channels with persistent history cannot be renamed"))
return false