forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delegate_ui.go
37 lines (31 loc) · 1.03 KB
/
delegate_ui.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package service
import (
"github.com/keybase/client/go/libkb"
rpc "github.com/keybase/go-framed-msgpack-rpc"
context "golang.org/x/net/context"
)
// NotifyCtlHandler is the RPC handler for notify control messages
type DelegateUICtlHandler struct {
libkb.Contextified
*BaseHandler
id libkb.ConnectionID
}
// NewNotifyCtlHandler creates a new handler for setting up notification
// channels
func NewDelegateUICtlHandler(xp rpc.Transporter, id libkb.ConnectionID, g *libkb.GlobalContext) *DelegateUICtlHandler {
return &DelegateUICtlHandler{
Contextified: libkb.NewContextified(g),
BaseHandler: NewBaseHandler(xp),
id: id,
}
}
func (d *DelegateUICtlHandler) RegisterIdentifyUI(_ context.Context) error {
d.G().UIRouter.SetUI(d.id, libkb.IdentifyUIKind)
return nil
}
func (d *DelegateUICtlHandler) RegisterSecretUI(_ context.Context) error {
d.G().UIRouter.SetUI(d.id, libkb.SecretUIKind)
return nil
}