mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-21 09:44:21 +01:00
Merge pull request #2210 from slingamn/rearrange
tweaks to logging and NS PUSH LIST
This commit is contained in:
commit
2a79f64f2d
@ -682,7 +682,7 @@ func (client *Client) run(session *Session) {
|
|||||||
if err == errInvalidUtf8 {
|
if err == errInvalidUtf8 {
|
||||||
invalidUtf8 = true // handle as normal, including labeling
|
invalidUtf8 = true // handle as normal, including labeling
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
client.server.logger.Debug("connect-ip", "read error from client", err.Error())
|
client.server.logger.Debug("connect-ip", session.connID, "read error from client", err.Error())
|
||||||
var quitMessage string
|
var quitMessage string
|
||||||
switch err {
|
switch err {
|
||||||
case ircreader.ErrReadQ:
|
case ircreader.ErrReadQ:
|
||||||
|
@ -1324,6 +1324,9 @@ func nsClientsListHandler(service *ircService, server *Server, client *Client, p
|
|||||||
if session.deviceID != "" {
|
if session.deviceID != "" {
|
||||||
service.Notice(rb, fmt.Sprintf(client.t("Device ID: %s"), session.deviceID))
|
service.Notice(rb, fmt.Sprintf(client.t("Device ID: %s"), session.deviceID))
|
||||||
}
|
}
|
||||||
|
if hasPrivs {
|
||||||
|
service.Notice(rb, fmt.Sprintf(client.t("Debug log ID: %s"), session.connID))
|
||||||
|
}
|
||||||
service.Notice(rb, fmt.Sprintf(client.t("IP address: %s"), session.ip.String()))
|
service.Notice(rb, fmt.Sprintf(client.t("IP address: %s"), session.ip.String()))
|
||||||
service.Notice(rb, fmt.Sprintf(client.t("Hostname: %s"), session.hostname))
|
service.Notice(rb, fmt.Sprintf(client.t("Hostname: %s"), session.hostname))
|
||||||
if hasPrivs {
|
if hasPrivs {
|
||||||
@ -1339,9 +1342,6 @@ func nsClientsListHandler(service *ircService, server *Server, client *Client, p
|
|||||||
service.Notice(rb, fmt.Sprintf(client.t("IRCv3 CAPs: %s"), capStr))
|
service.Notice(rb, fmt.Sprintf(client.t("IRCv3 CAPs: %s"), capStr))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if hasPrivs {
|
|
||||||
service.Notice(rb, fmt.Sprintf(client.t("Debug log ID: %s"), session.connID))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1686,7 +1686,10 @@ func nsPushHandler(service *ircService, server *Server, client *Client, command
|
|||||||
subscriptions := target.getPushSubscriptions()
|
subscriptions := target.getPushSubscriptions()
|
||||||
service.Notice(rb, fmt.Sprintf(client.t("Nickname %[1]s has %[2]d push subscription(s)"), target.Nick(), len(subscriptions)))
|
service.Notice(rb, fmt.Sprintf(client.t("Nickname %[1]s has %[2]d push subscription(s)"), target.Nick(), len(subscriptions)))
|
||||||
for i, subscription := range subscriptions {
|
for i, subscription := range subscriptions {
|
||||||
service.Notice(rb, fmt.Sprintf("%d: %s", i, subscription.Endpoint))
|
service.Notice(rb, fmt.Sprintf(client.t("Subscription %d:"), i+1))
|
||||||
|
service.Notice(rb, fmt.Sprintf(client.t("Endpoint: %s"), subscription.Endpoint))
|
||||||
|
service.Notice(rb, fmt.Sprintf(client.t("Last renewal: %s"), subscription.LastRefresh.Format(time.RFC1123)))
|
||||||
|
service.Notice(rb, fmt.Sprintf(client.t("Last push: %s"), subscription.LastSuccess.Format(time.RFC1123)))
|
||||||
}
|
}
|
||||||
case "DELETE":
|
case "DELETE":
|
||||||
if len(params) < 2 {
|
if len(params) < 2 {
|
||||||
|
@ -223,7 +223,6 @@ func serviceRunCommand(service *ircService, server *Server, client *Client, cmd
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
server.logger.Debug("services", fmt.Sprintf("Client %s ran %s command %s", client.Nick(), service.Name, commandName))
|
|
||||||
if commandName == "help" {
|
if commandName == "help" {
|
||||||
serviceHelpHandler(service, server, client, params, rb)
|
serviceHelpHandler(service, server, client, params, rb)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user