Skip to content

Commit

Permalink
automod/automod_legacy REALLY fix link matching this time
Browse files Browse the repository at this point in the history
  • Loading branch information
jogramming committed Jan 20, 2019
1 parent beecae6 commit 19da972
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion automod/triggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (dt *DomainTrigger) CheckMessage(ms *dstate.MemberState, cs *dstate.Channel
}

func (dt *DomainTrigger) containsDomain(link string, list []string) (bool, string) {
if !strings.HasPrefix(link, "http://") && !strings.HasPrefix(link, "https://") && strings.HasPrefix(link, "steam://") {
if !strings.HasPrefix(link, "http://") && !strings.HasPrefix(link, "https://") && !strings.HasPrefix(link, "steam://") {
link = "http://" + link
}

Expand Down
2 changes: 1 addition & 1 deletion automod_legacy/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func (s *SitesRule) checkMessage(message string) (banned bool, item string, thre

for _, v := range matches {

if !strings.HasPrefix(v, "http://") && !strings.HasPrefix(v, "https://") && strings.HasPrefix(v, "steam://") {
if !strings.HasPrefix(v, "http://") && !strings.HasPrefix(v, "https://") && !strings.HasPrefix(v, "steam://") {
v = "http://" + v
}

Expand Down

0 comments on commit 19da972

Please sign in to comment.