4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 13:09:24 +00:00

Update vendor lrstanley/girc

This commit is contained in:
Wim
2018-09-14 00:18:20 +02:00
parent a431a4fa04
commit e0ca876de2
6 changed files with 28 additions and 8 deletions

View File

@ -102,7 +102,7 @@ func handleCAP(c *Client, e Event) {
possible := possibleCapList(c)
if len(e.Params) >= 2 && len(e.Trailing) > 1 && e.Params[1] == CAP_LS {
if len(e.Params) >= 2 && e.Params[1] == CAP_LS {
c.state.Lock()
caps := parseCap(e.Trailing)

View File

@ -135,7 +135,7 @@ type Config struct {
// PingDelay is the frequency between when the client sends a keep-alive
// PING to the server, and awaits a response (and times out if the server
// doesn't respond in time). This should be between 20-600 seconds. See
// Client.Lag() if you want to determine the delay between the server
// Client.Latency() if you want to determine the delay between the server
// and the client. If this is set to -1, the client will not attempt to
// send client -> server PING requests.
PingDelay time.Duration

View File

@ -51,7 +51,7 @@ type Event struct {
// Trailing text. e.g. with a PRIVMSG, this is the message text (part
// after the colon.)
Trailing string `json:"trailing"`
// EmptyTrailign, if true, the text prefix (:) will be added even if
// EmptyTrailing, if true, the text prefix (:) will be added even if
// Event.Trailing is empty.
EmptyTrailing bool `json:"empty_trailing"`
// Sensitive should be true if the message is sensitive (e.g. and should
@ -383,12 +383,30 @@ func (e *Event) Pretty() (out string, ok bool) {
return fmt.Sprintf("[*] %s has quit (%s)", e.Source.Name, e.Trailing), true
}
if e.Command == KICK && len(e.Params) == 2 {
if e.Command == INVITE && len(e.Params) == 1 {
return fmt.Sprintf("[*] %s invited to %s by %s", e.Params[0], e.Trailing, e.Source.Name), true
}
if e.Command == KICK && len(e.Params) >= 2 {
if e.Trailing == "" && len(e.Params) == 3 {
e.Trailing = e.Params[2]
}
return fmt.Sprintf("[%s] *** %s has kicked %s: %s", e.Params[0], e.Source.Name, e.Params[1], e.Trailing), true
}
if e.Command == NICK && len(e.Params) == 1 {
return fmt.Sprintf("[*] %s is now known as %s", e.Source.Name, e.Params[0]), true
if e.Command == NICK {
// Workaround, see https://github.com/lrstanley/girc/pull/15#issuecomment-413845482
var name string
if len(e.Params) == 1 {
name = e.Params[0]
} else if len(e.Trailing) > 0 {
name = e.Trailing
}
if name != "" {
return fmt.Sprintf("[*] %s is now known as %s", e.Source.Name, name), true
}
}
if e.Command == TOPIC && len(e.Params) > 0 {

2
vendor/modules.txt vendored
View File

@ -62,7 +62,7 @@ github.com/labstack/gommon/color
github.com/labstack/gommon/log
github.com/labstack/gommon/bytes
github.com/labstack/gommon/random
# github.com/lrstanley/girc v0.0.0-20180427160007-102f17f86306
# github.com/lrstanley/girc v0.0.0-20180913221000-0fb5b684054e
github.com/lrstanley/girc
# github.com/magiconair/properties v0.0.0-20180217134545-2c9e95027885
github.com/magiconair/properties