-
Notifications
You must be signed in to change notification settings - Fork 25
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
Various improvements over commands #106
Conversation
…ubscribe and handle commandTrigger on help text
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.
one nit and a small suggestion
Codecov Report
@@ Coverage Diff @@
## master #106 +/- ##
==========================================
- Coverage 23.04% 22.95% -0.10%
==========================================
Files 62 63 +1
Lines 2274 2270 -4
==========================================
- Hits 524 521 -3
+ Misses 1692 1688 -4
- Partials 58 61 +3
Continue to review full report at Codecov.
|
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.
LGTM
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.
Nice, I really like the cleanup of the code. Thanks for noticing the opportunity for improvement. I have some suggestions on user-friendly wordings of errors.
server/command/subscribe.go
Outdated
} | ||
return "bad syntax", nil | ||
return fmt.Sprintf("Subscription %s created.", storedSub.Remote.ID), nil |
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.
Do we want to say something more user-friendly like You are now subscribed to events.
?
server/command/unsubscribe.go
Outdated
if err != nil { | ||
return "", err | ||
} | ||
return fmt.Sprintf("User's subscription deleted"), nil |
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.
return fmt.Sprintf("User's subscription deleted"), nil | |
return fmt.Sprintf("You have unsubscribed from events."), nil |
server/command/subscribe.go
Outdated
return fmt.Sprintf("Subscription %s deleted", parameters[1]), nil | ||
_, err := c.MSCalendar.LoadMyEventSubscription() | ||
if err == nil { | ||
return "Already subscribed to events.", nil |
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.
return "Already subscribed to events.", nil | |
return "You are already subscribed to events.", nil |
…cription list as a debug function.
return fmt.Sprintf("User's subscription deleted"), false, nil | ||
_, err := c.MSCalendar.LoadMyEventSubscription() | ||
if err == nil { | ||
return "You are already subscribed to events.", false, nil |
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.
If for some reason the renew job does not end up renewing the user's subscription (MM server is taken down for a few days for example), does this make it so the user cannot remedy the situation? The renew job would also not be able to fix it either.
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.
I haven't checked the details, but shouldn't a "unsubscribe/subscribe" fix it?
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.
LGTM
/update-branch |
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.
Tested and passed
- Various commands now explain when you're not connected
- I also see a few other text improvments
- When already connected - It explains why connect fails now :)
- Subscribe now informs user they are already subscribed rather than creating additional subscriptions
- Unsubscribe works as expected.
LGTM!
Thanks @larkox
Summary
I added some small improvements to the current commands:
mscalendar
Ticket Link
fix #49