summaryrefslogtreecommitdiffstats
path: root/plugin/api.go
diff options
context:
space:
mode:
authorJesse Hallam <jesse.hallam@gmail.com>2018-04-06 17:08:57 -0400
committerJoram Wilander <jwawilander@gmail.com>2018-04-06 17:08:57 -0400
commit116849842be59bc6960df415f23155ec8e767f06 (patch)
tree582794ce6efc92f4564118cbb0a1841699f16a19 /plugin/api.go
parentff077c6761bd4b6d170831f7f2ba474c2a9bd5e0 (diff)
downloadchat-116849842be59bc6960df415f23155ec8e767f06.tar.gz
chat-116849842be59bc6960df415f23155ec8e767f06.tar.bz2
chat-116849842be59bc6960df415f23155ec8e767f06.zip
MM-8678: add CUD support for channel members via plugins (#8565)
* add CUD support for channel members via plugins This effectively exposes AddChannelMember, UpdateChannelMemberRoles, UpdateChannelMemberNotifyProps and LeaveChannel via the plugin API. It also modifies the semantics of AddChannelMember to explicitly allow for an empty user requestor, left as such for now via the plugin API. * change the signature of AddChannelMember to accept a channel id instead of a channel
Diffstat (limited to 'plugin/api.go')
-rw-r--r--plugin/api.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugin/api.go b/plugin/api.go
index 437188f6e..d62c2f069 100644
--- a/plugin/api.go
+++ b/plugin/api.go
@@ -77,9 +77,21 @@ type API interface {
// UpdateChannel updates a channel.
UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
+ // AddChannelMember creates a channel membership for a user.
+ AddChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError)
+
// GetChannelMember gets a channel membership for a user.
GetChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError)
+ // UpdateChannelMemberRoles updates a user's roles for a channel.
+ UpdateChannelMemberRoles(channelId, userId, newRoles string) (*model.ChannelMember, *model.AppError)
+
+ // UpdateChannelMemberNotifications updates a user's notification properties for a channel.
+ UpdateChannelMemberNotifications(channelId, userId string, notifications map[string]string) (*model.ChannelMember, *model.AppError)
+
+ // DeleteChannelMember deletes a channel membership for a user.
+ DeleteChannelMember(channelId, userId string) *model.AppError
+
// CreatePost creates a post.
CreatePost(post *model.Post) (*model.Post, *model.AppError)