user status: Add frontend data layer for "status_text".

This sets up the frontend to handle "status_text" data like
"out to lunch" or "in a meeting".
This commit is contained in:
Steve Howell
2019-01-23 18:25:22 +00:00
committed by Tim Abbott
parent 0ef5d1f9c8
commit 513d666ba1
3 changed files with 62 additions and 17 deletions

View File

@@ -458,10 +458,19 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
break;
case 'user_status':
if (event.away) {
activity.on_set_away(event.user_id);
} else {
activity.on_revoke_away(event.user_id);
if (event.away !== undefined) {
if (event.away) {
activity.on_set_away(event.user_id);
} else {
activity.on_revoke_away(event.user_id);
}
}
if (event.info !== undefined) {
user_status.set_status_text({
user_id: event.user_id,
status_text: event.info,
});
}
break;
}