forked from keybase/client
/
remote_chat_ui.go
92 lines (73 loc) · 3.04 KB
/
remote_chat_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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package service
import (
"golang.org/x/net/context"
"github.com/keybase/client/go/protocol/chat1"
"github.com/keybase/go-framed-msgpack-rpc/rpc"
)
type RemoteChatUI struct {
sessionID int
cli chat1.ChatUiClient
}
func NewRemoteChatUI(sessionID int, c *rpc.Client) *RemoteChatUI {
return &RemoteChatUI{
sessionID: sessionID,
cli: chat1.ChatUiClient{Cli: c},
}
}
func (r *RemoteChatUI) ChatAttachmentUploadOutboxID(ctx context.Context, arg chat1.ChatAttachmentUploadOutboxIDArg) error {
arg.SessionID = r.sessionID
return r.cli.ChatAttachmentUploadOutboxID(ctx, arg)
}
func (r *RemoteChatUI) ChatAttachmentUploadStart(ctx context.Context, metadata chat1.AssetMetadata, placeholder chat1.MessageID) error {
arg := chat1.ChatAttachmentUploadStartArg{
SessionID: r.sessionID,
Metadata: metadata,
PlaceholderMsgID: placeholder,
}
return r.cli.ChatAttachmentUploadStart(ctx, arg)
}
func (r *RemoteChatUI) ChatAttachmentUploadProgress(ctx context.Context, arg chat1.ChatAttachmentUploadProgressArg) error {
arg.SessionID = r.sessionID
return r.cli.ChatAttachmentUploadProgress(ctx, arg)
}
func (r *RemoteChatUI) ChatAttachmentUploadDone(ctx context.Context) error {
return r.cli.ChatAttachmentUploadDone(ctx, r.sessionID)
}
func (r *RemoteChatUI) ChatAttachmentPreviewUploadStart(ctx context.Context, metadata chat1.AssetMetadata) error {
arg := chat1.ChatAttachmentPreviewUploadStartArg{
SessionID: r.sessionID,
Metadata: metadata,
}
return r.cli.ChatAttachmentPreviewUploadStart(ctx, arg)
}
func (r *RemoteChatUI) ChatAttachmentPreviewUploadDone(ctx context.Context) error {
return r.cli.ChatAttachmentPreviewUploadDone(ctx, r.sessionID)
}
func (r *RemoteChatUI) ChatAttachmentDownloadStart(ctx context.Context) error {
return r.cli.ChatAttachmentDownloadStart(ctx, r.sessionID)
}
func (r *RemoteChatUI) ChatAttachmentDownloadProgress(ctx context.Context, arg chat1.ChatAttachmentDownloadProgressArg) error {
arg.SessionID = r.sessionID
return r.cli.ChatAttachmentDownloadProgress(ctx, arg)
}
func (r *RemoteChatUI) ChatAttachmentDownloadDone(ctx context.Context) error {
return r.cli.ChatAttachmentDownloadDone(ctx, r.sessionID)
}
func (r *RemoteChatUI) ChatInboxConversation(ctx context.Context, arg chat1.ChatInboxConversationArg) error {
return r.cli.ChatInboxConversation(ctx, arg)
}
func (r *RemoteChatUI) ChatInboxFailed(ctx context.Context, arg chat1.ChatInboxFailedArg) error {
return r.cli.ChatInboxFailed(ctx, arg)
}
func (r *RemoteChatUI) ChatInboxUnverified(ctx context.Context, arg chat1.ChatInboxUnverifiedArg) error {
return r.cli.ChatInboxUnverified(ctx, arg)
}
func (r *RemoteChatUI) ChatThreadCached(ctx context.Context, arg chat1.ChatThreadCachedArg) error {
return r.cli.ChatThreadCached(ctx, arg)
}
func (r *RemoteChatUI) ChatThreadFull(ctx context.Context, arg chat1.ChatThreadFullArg) error {
return r.cli.ChatThreadFull(ctx, arg)
}
func (r *RemoteChatUI) ChatConfirmChannelDelete(ctx context.Context, arg chat1.ChatConfirmChannelDeleteArg) (bool, error) {
return r.cli.ChatConfirmChannelDelete(ctx, arg)
}