Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions server/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ const (
SettingReminders = "reminders"
SettingOn = "on"
SettingOff = "off"
chimeraGitLabAppIdentifier = "plugin-gitlab"
Comment thread
raghavaggarwal2308 marked this conversation as resolved.
Outdated

chimeraGitLabAppIdentifier = "plugin-gitlab"
ActionNameMemberAccessRequest = "member_access_requested"
Comment thread
raghavaggarwal2308 marked this conversation as resolved.
Outdated

invalidTokenError = "401 {error: invalid_token}" //#nosec G101 -- False positive
)
Expand Down Expand Up @@ -606,7 +607,14 @@ func (p *Plugin) GetToDo(ctx context.Context, user *gitlab.UserInfo) (bool, stri
continue
}
notificationCount++
notificationContent += fmt.Sprintf("* %v : [%v](%v)\n", n.ActionName, n.Target.Title, n.TargetURL)

switch n.ActionName {
// Handling this cases specifically as the "Title" field is empty in this case
Comment thread
raghavaggarwal2308 marked this conversation as resolved.
Outdated
case ActionNameMemberAccessRequest:
notificationContent += fmt.Sprintf("* %v : [%v](%v) has requested access to [%v](%v)\n", n.ActionName, n.Author.Name, n.Author.WebURL, n.Body, n.TargetURL)
default:
notificationContent += fmt.Sprintf("* %v : [%v](%v)\n", n.ActionName, n.Target.Title, n.TargetURL)
}
}

if notificationCount == 0 {
Expand Down