discord: add nosendjoinpart support
This allows the discord bridge to be configured with `nosendjoinpart`, preventing discord-originating join/part messages from being send to other bridged platforms.
This commit is contained in:
@@ -171,6 +171,9 @@ func (b *Bdiscord) memberUpdate(s *discordgo.Session, m *discordgo.GuildMemberUp
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bdiscord) memberAdd(s *discordgo.Session, m *discordgo.GuildMemberAdd) {
|
func (b *Bdiscord) memberAdd(s *discordgo.Session, m *discordgo.GuildMemberAdd) {
|
||||||
|
if b.GetBool("nosendjoinpart") {
|
||||||
|
return
|
||||||
|
}
|
||||||
if m.Member == nil {
|
if m.Member == nil {
|
||||||
b.Log.Warnf("Received member update with no member information: %#v", m)
|
b.Log.Warnf("Received member update with no member information: %#v", m)
|
||||||
return
|
return
|
||||||
@@ -192,6 +195,9 @@ func (b *Bdiscord) memberAdd(s *discordgo.Session, m *discordgo.GuildMemberAdd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bdiscord) memberRemove(s *discordgo.Session, m *discordgo.GuildMemberRemove) {
|
func (b *Bdiscord) memberRemove(s *discordgo.Session, m *discordgo.GuildMemberRemove) {
|
||||||
|
if b.GetBool("nosendjoinpart") {
|
||||||
|
return
|
||||||
|
}
|
||||||
if m.Member == nil {
|
if m.Member == nil {
|
||||||
b.Log.Warnf("Received member update with no member information: %#v", m)
|
b.Log.Warnf("Received member update with no member information: %#v", m)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ ShowJoinPart=false
|
|||||||
VerboseJoinPart=false
|
VerboseJoinPart=false
|
||||||
|
|
||||||
#Do not send joins/parts to other bridges
|
#Do not send joins/parts to other bridges
|
||||||
#Currently works for messages from the following bridges: irc, mattermost, slack
|
#Currently works for messages from the following bridges: irc, mattermost, slack, discord
|
||||||
#OPTIONAL (default false)
|
#OPTIONAL (default false)
|
||||||
NoSendJoinPart=false
|
NoSendJoinPart=false
|
||||||
|
|
||||||
@@ -496,7 +496,7 @@ RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
|
|||||||
ShowJoinPart=false
|
ShowJoinPart=false
|
||||||
|
|
||||||
#Do not send joins/parts to other bridges
|
#Do not send joins/parts to other bridges
|
||||||
#Currently works for messages from the following bridges: irc, mattermost, slack
|
#Currently works for messages from the following bridges: irc, mattermost, slack, discord
|
||||||
#OPTIONAL (default false)
|
#OPTIONAL (default false)
|
||||||
NoSendJoinPart=false
|
NoSendJoinPart=false
|
||||||
|
|
||||||
@@ -830,7 +830,7 @@ RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
|
|||||||
ShowJoinPart=false
|
ShowJoinPart=false
|
||||||
|
|
||||||
#Do not send joins/parts to other bridges
|
#Do not send joins/parts to other bridges
|
||||||
#Currently works for messages from the following bridges: irc, mattermost, slack
|
#Currently works for messages from the following bridges: irc, mattermost, slack, discord
|
||||||
#OPTIONAL (default false)
|
#OPTIONAL (default false)
|
||||||
NoSendJoinPart=false
|
NoSendJoinPart=false
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user