forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notify.go
33 lines (28 loc) · 968 Bytes
/
notify.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
// 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"
keybase1 "github.com/keybase/client/go/protocol"
rpc "github.com/keybase/go-framed-msgpack-rpc"
context "golang.org/x/net/context"
)
// NotifyCtlHandler is the RPC handler for notify control messages
type NotifyCtlHandler struct {
libkb.Contextified
*BaseHandler
id libkb.ConnectionID
}
// NewNotifyCtlHandler creates a new handler for setting up notification
// channels
func NewNotifyCtlHandler(xp rpc.Transporter, id libkb.ConnectionID, g *libkb.GlobalContext) *NotifyCtlHandler {
return &NotifyCtlHandler{
Contextified: libkb.NewContextified(g),
BaseHandler: NewBaseHandler(xp),
id: id,
}
}
func (h *NotifyCtlHandler) SetNotifications(_ context.Context, n keybase1.NotificationChannels) error {
h.G().NotifyRouter.SetChannels(h.id, n)
return nil
}