-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MM-382] Add feature to use struct fields in the channel welcome message #130
base: master
Are you sure you want to change the base?
Conversation
server/welcomebot.go
Outdated
if len(channelID) > 0 { | ||
data.Channel, err = p.API.GetChannel(channelID) | ||
if err != nil { | ||
p.API.LogError("failed to query channel", "ChannelID", channelID) | ||
return nil | ||
} | ||
} | ||
|
||
data.UserDisplayName = data.User.GetDisplayName(model.ShowNicknameFullName) | ||
|
||
return data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it the case that channelID
will always be provided and non-empty? Is it the case that this function must return a fully populated ChannelMessageTemplate
?
If that's the case, we should return an error if necessary passed in data is not available. Not sure about the situation here though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is not necessary to pass the channel ID here. Also, the function doesn't need to return a fully populated ChannelMessageTemplate
.
Summary
Screenshot
Ticket Link
Fixes #96
Fixes #55
What to test?
Checklist
make test
Ran test cases and ensured they are passingmake check-style
Ran style check and ensured both webapp and server pass the checks