Added GETEmojilist plugin api (#9750)
* Add GetEmojiList plugin api * Fixed bug in getemojilist causing build test failure * Fix linting error * Add requested changes * Fix all conflicts
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
789b2f72dd
Коммит
f6b1ccbcb1
@@ -2432,6 +2432,37 @@ func (s *apiRPCServer) GetProfileImage(args *Z_GetProfileImageArgs, returns *Z_G
|
||||
return nil
|
||||
}
|
||||
|
||||
type Z_GetEmojiListArgs struct {
|
||||
A string
|
||||
B int
|
||||
C int
|
||||
}
|
||||
|
||||
type Z_GetEmojiListReturns struct {
|
||||
A []*model.Emoji
|
||||
B *model.AppError
|
||||
}
|
||||
|
||||
func (g *apiRPCClient) GetEmojiList(sortBy string, page, perPage int) ([]*model.Emoji, *model.AppError) {
|
||||
_args := &Z_GetEmojiListArgs{sortBy, page, perPage}
|
||||
_returns := &Z_GetEmojiListReturns{}
|
||||
if err := g.client.Call("Plugin.GetEmojiList", _args, _returns); err != nil {
|
||||
log.Printf("RPC call to GetEmojiList API failed: %s", err.Error())
|
||||
}
|
||||
return _returns.A, _returns.B
|
||||
}
|
||||
|
||||
func (s *apiRPCServer) GetEmojiList(args *Z_GetEmojiListArgs, returns *Z_GetEmojiListReturns) error {
|
||||
if hook, ok := s.impl.(interface {
|
||||
GetEmojiList(sortBy string, page, perPage int) ([]*model.Emoji, *model.AppError)
|
||||
}); ok {
|
||||
returns.A, returns.B = hook.GetEmojiList(args.A, args.B, args.C)
|
||||
} else {
|
||||
return encodableError(fmt.Errorf("API GetEmojiList called but not implemented."))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Z_GetEmojiByNameArgs struct {
|
||||
A string
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user