4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-06 07:14:04 +00:00

Add support for irc to irc notice (irc). Fixes #754 (#1305)

This commit is contained in:
Wim
2020-11-22 22:21:02 +01:00
committed by GitHub
parent 64b899ac89
commit b24e1bafa1
4 changed files with 27 additions and 4 deletions

View File

@ -170,7 +170,14 @@ func (b *Birc) handlePrivMsg(client *girc.Client, event girc.Event) {
if b.skipPrivMsg(event) {
return
}
rmsg := config.Message{Username: event.Source.Name, Channel: strings.ToLower(event.Params[0]), Account: b.Account, UserID: event.Source.Ident + "@" + event.Source.Host}
rmsg := config.Message{
Username: event.Source.Name,
Channel: strings.ToLower(event.Params[0]),
Account: b.Account,
UserID: event.Source.Ident + "@" + event.Source.Host,
}
b.Log.Debugf("== Receiving PRIVMSG: %s %s %#v", event.Source.Name, event.Last(), event)
// set action event
@ -178,6 +185,11 @@ func (b *Birc) handlePrivMsg(client *girc.Client, event girc.Event) {
rmsg.Event = config.EventUserAction
}
// set NOTICE event
if event.Command == "NOTICE" {
rmsg.Event = config.EventNoticeIRC
}
// strip action, we made an event if it was an action
rmsg.Text += event.StripAction()