Skip to content

Commit 7df3d8b

Browse files
[MM-956]: Removed extra lines of code
1 parent 17daeee commit 7df3d8b

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

server/plugin/subscriptions.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,11 @@ func (p *Plugin) StoreSubscriptions(s *Subscriptions) error {
317317
func (p *Plugin) GetSubscribedChannelsForRepository(repo *github.Repository) []*Subscription {
318318
name := repo.GetFullName()
319319
name = strings.ToLower(name)
320-
fmt.Println("name ", name)
321320
org := strings.Split(name, "/")[0]
322321
subs, err := p.GetSubscriptions()
323322
if err != nil {
324323
return nil
325324
}
326-
fmt.Println("subs ", subs)
327325

328326
// Add subscriptions for the specific repo
329327
subsForRepo := []*Subscription{}
@@ -344,7 +342,6 @@ func (p *Plugin) GetSubscribedChannelsForRepository(repo *github.Repository) []*
344342
subsToReturn := []*Subscription{}
345343

346344
for _, sub := range subsForRepo {
347-
fmt.Println("sub 1", sub)
348345
if repo.GetPrivate() && !p.permissionToRepo(sub.CreatorID, name) {
349346
continue
350347
}

server/plugin/webhook.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -651,50 +651,35 @@ func (p *Plugin) postIssueEvent(event *github.IssuesEvent) {
651651

652652
func (p *Plugin) postPushEvent(event *github.PushEvent) {
653653
repo := event.GetRepo()
654-
fmt.Println("postPushEvent 1")
655654

656655
subs := p.GetSubscribedChannelsForRepository(ConvertPushEventRepositoryToRepository(repo))
657-
fmt.Println("postPushEvent 2")
658656
if len(subs) == 0 {
659-
fmt.Println("postPushEvent 3")
660657
return
661658
}
662659

663660
commits := event.Commits
664-
fmt.Println("postPushEvent 4")
665661
if len(commits) == 0 {
666-
fmt.Println("postPushEvent 5")
667662
return
668663
}
669664

670665
setShowAuthorInCommitNotification(p.configuration.ShowAuthorInCommitNotification)
671-
fmt.Println("postPushEvent 6")
672666
pushedCommitsMessage, err := renderTemplate("pushedCommits", event)
673-
fmt.Println("postPushEvent 7")
674667
if err != nil {
675-
fmt.Println("postPushEvent 8")
676668
p.client.Log.Warn("Failed to render template", "error", err.Error())
677669
return
678670
}
679671

680672
for _, sub := range subs {
681-
fmt.Println("postPushEvent 9")
682673
if !sub.Pushes() {
683-
fmt.Println("postPushEvent 10")
684674
continue
685675
}
686-
fmt.Println("postPushEvent 11")
687676
if p.excludeConfigOrgMember(event.GetSender(), sub) {
688-
fmt.Println("postPushEvent 12")
689677
continue
690678
}
691-
fmt.Println("postPushEvent 13")
692679
post := p.makeBotPost(pushedCommitsMessage, "custom_git_push")
693680

694681
post.ChannelId = sub.ChannelID
695-
fmt.Println("postPushEvent 14")
696682
if err = p.client.Post.CreatePost(post); err != nil {
697-
fmt.Println("postPushEvent 15")
698683
p.client.Log.Warn("Error webhook post", "post", post, "error", err.Error())
699684
}
700685
}

0 commit comments

Comments
 (0)