Skip to content
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

fix: Summoner - Use username if name is missing #406

Merged
merged 1 commit into from
Feb 28, 2017
Merged

fix: Summoner - Use username if name is missing #406

merged 1 commit into from
Feb 28, 2017

Conversation

RaceProUK
Copy link
Contributor

No description provided.

@@ -46,6 +46,9 @@ module.exports = function summoner(forum, config) {
debug('summoner received a mention notification!');
return notification.getUser()
.then((user) => {
if (user.username && !user.name) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a workable solution, but somewhat lacking in extensibility. what about other field combinations where information might be lacking and an alternate must be chosen.

wouldn't a replacement syntax of %name|username% to mean "name unless it is null or whitespace then use username" be a more elegant solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. For now though, I think this achieves what I intended. I can always go back and implement the more extensible version later 🙂

@AccaliaDeElementia AccaliaDeElementia merged commit 76b18ae into SockDrawer:master Feb 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants