mirror of
https://salsa.debian.org/mdosch/feed-to-muc.git
synced 2024-11-22 14:08:39 +01:00
[gocritic]: Improve code quality.
This commit is contained in:
parent
91e91b68ae
commit
b2714d0582
1 changed files with 22 additions and 0 deletions
|
@ -190,6 +190,28 @@ func processStanzas(client *xmpp.Client, muc string, mucNick string, feeds []str
|
||||||
log.Fatal("Error: Failed sending message to ", v.Remote, ": ", err)
|
log.Fatal("Error: Failed sending message to ", v.Remote, ": ", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
reply := `Unknown command, type "help" for a list of supported commands.`
|
||||||
|
if v.Type == "groupchat" {
|
||||||
|
_, err = client.Send(xmpp.Chat{
|
||||||
|
Remote: muc,
|
||||||
|
Type: "groupchat", Text: strings.Split(v.Remote, "/")[1] + ": " + reply,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal("Error: Failed sending message to MUC:", err)
|
||||||
|
}
|
||||||
|
} else if v.Type == "chat" {
|
||||||
|
_, err = client.Send(xmpp.Chat{
|
||||||
|
Remote: v.Remote,
|
||||||
|
Type: "chat", Text: reply,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal("Error: Failed sending message to ", v.Remote, ": ", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reply with repo address for `source`.
|
||||||
|
case "source":
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reply to pings and disco queries.
|
// Reply to pings and disco queries.
|
||||||
|
|
Loading…
Reference in a new issue