Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisab authored and JonasPf committed Dec 10, 2020
1 parent b67f9b1 commit d3c987d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/services/rocketchat/rocketchat_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package rocketchat
import (
"errors"
"fmt"
"github.com/containrrr/shoutrrr/pkg/services/standard"
"net/url"
"strings"

"github.com/containrrr/shoutrrr/pkg/services/standard"
)

// Config for the rocket.chat service
Expand Down Expand Up @@ -48,7 +49,9 @@ func (config *Config) SetURL(serviceURL *url.URL) error {
config.TokenA = path[1]
config.TokenB = path[2]
if len(path) > 3 {
if path[3][0:1] != "@" {
if serviceURL.Fragment != "" {
config.Channel = "#" + strings.TrimPrefix(serviceURL.Fragment, "#")
} else if !strings.HasPrefix(path[3], "@") {
config.Channel = "#" + path[3]
} else {
config.Channel = path[3]
Expand Down

0 comments on commit d3c987d

Please sign in to comment.