Business Logic in Mattermost
Microsoft Statuses
Microsoft can let us know a user's status at a given time using one of five available options.
...
free
if dnd, set online
tentative
if not dnd, set dnd
busy
if not dnd, set dnd
out of office
?
working elsewhere
?
Mattermost Implementation
We currently have a system to update a user’s status that uses a boolean flag manual
to represent that it is a manual action by the user that is changing the status. These manual actions always override whatever the current status is. The plugin API method UpdateUserStatus
automatically uses the manual=true
for the value of the flag, so it is the same as user manually doing it as far as the status handling is concerned.
Concerns
We may need to change the way the
manual
boolean flag is used, so the plugin may have slightly less precedence than the user’s manual choices.If a user was previously busy but is now free, we need to determine if they should be set to online, away, or offline. Ideally we set them as whatever they were set to before we set them to dnd earlier.
In order for the user to be aware of when the plugin changes his status, the application could tell the user in-app that his status has been changed for him by the plugin.
The plugin needs to use all available info to determine if the user's status needs to change. This could include special settings that user can set themselves. Maybe a user config value that says “Microsoft Plugin, take the wheel for x hours.”
We need to keep track of if we’ve already taken care of the user’s current availability. i.e. we already set them to out of office for this event, don’t set it again if the user has set it to something else since then.
...