summaryrefslogtreecommitdiffstats
path: root/plugin/api.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-07-16 15:49:26 -0400
committerGitHub <noreply@github.com>2018-07-16 15:49:26 -0400
commit275731578e72d2c6e12cfb2fc315d3446474faec (patch)
tree25df7525ed2244c7dec5be44495b45ffc0ae1023 /plugin/api.go
parent88eef609ab712097ff2b13a2ca45c31ea6fa7df2 (diff)
downloadchat-275731578e72d2c6e12cfb2fc315d3446474faec.tar.gz
chat-275731578e72d2c6e12cfb2fc315d3446474faec.tar.bz2
chat-275731578e72d2c6e12cfb2fc315d3446474faec.zip
MM-10254 Add plugin APIs for getting/updating user statuses (#9101)
* Add plugin APIs for getting/updating user statuses * Add and update tests * Updates per feedback
Diffstat (limited to 'plugin/api.go')
-rw-r--r--plugin/api.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugin/api.go b/plugin/api.go
index 76df9377a..70a3e7ab5 100644
--- a/plugin/api.go
+++ b/plugin/api.go
@@ -49,6 +49,16 @@ type API interface {
// UpdateUser updates a user.
UpdateUser(user *model.User) (*model.User, *model.AppError)
+ // GetUserStatus will get a user's status.
+ GetUserStatus(userId string) (*model.Status, *model.AppError)
+
+ // GetUserStatusesByIds will return a list of user statuses based on the provided slice of user IDs.
+ GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError)
+
+ // UpdateUserStatus will set a user's status until the user, or another integration/plugin, sets it back to online.
+ // The status parameter can be: "online", "away", "dnd", or "offline".
+ UpdateUserStatus(userId, status string) (*model.Status, *model.AppError)
+
// CreateTeam creates a team.
CreateTeam(team *model.Team) (*model.Team, *model.AppError)