@@ -28,7 +28,7 @@ type ChatServiceHandler interface {
2828 ReactionV1 (context.Context , reactionOptionsV1 ) Reply
2929 DeleteV1 (context.Context , deleteOptionsV1 ) Reply
3030 AttachV1 (context.Context , attachOptionsV1 , chat1.ChatUiInterface , chat1.NotifyChatInterface ) Reply
31- DownloadV1 (context.Context , downloadOptionsV1 , chat1.ChatUiInterface ) Reply
31+ DownloadV1 (context.Context , downloadOptionsV1 , chat1.ChatUiInterface , chat1. NotifyChatInterface ) Reply
3232 SetStatusV1 (context.Context , setStatusOptionsV1 ) Reply
3333 MarkV1 (context.Context , markOptionsV1 ) Reply
3434 SearchInboxV1 (context.Context , searchInboxOptionsV1 ) Reply
@@ -892,9 +892,9 @@ func (c *chatServiceHandler) AttachV1(ctx context.Context, opts attachOptionsV1,
892892
893893// DownloadV1 implements ChatServiceHandler.DownloadV1.
894894func (c * chatServiceHandler ) DownloadV1 (ctx context.Context , opts downloadOptionsV1 ,
895- chatUI chat1.ChatUiInterface ) Reply {
895+ chatUI chat1.ChatUiInterface , notifyUI chat1. NotifyChatInterface ) Reply {
896896 if opts .NoStream && opts .Output != "-" {
897- return c .downloadV1NoStream (ctx , opts , chatUI )
897+ return c .downloadV1NoStream (ctx , opts , chatUI , notifyUI )
898898 }
899899 var fsink Sink
900900 if opts .Output == "-" {
@@ -914,10 +914,21 @@ func (c *chatServiceHandler) DownloadV1(ctx context.Context, opts downloadOption
914914 protocols := []rpc.Protocol {
915915 NewStreamUIProtocol (c .G ()),
916916 chat1 .ChatUiProtocol (c .chatUI ),
917+ chat1 .NotifyChatProtocol (notifyUI ),
917918 }
918919 if err := RegisterProtocolsWithContext (protocols , c .G ()); err != nil {
919920 return c .errReply (err )
920921 }
922+ cli , err := GetNotifyCtlClient (c .G ())
923+ if err != nil {
924+ return c .errReply (err )
925+ }
926+ channels := keybase1.NotificationChannels {
927+ Chatattachments : true ,
928+ }
929+ if err := cli .SetNotifications (context .TODO (), channels ); err != nil {
930+ return c .errReply (err )
931+ }
921932
922933 convID , rlimits , err := c .resolveAPIConvID (ctx , opts .ConversationID , opts .Channel )
923934 if err != nil {
@@ -955,7 +966,7 @@ func (c *chatServiceHandler) DownloadV1(ctx context.Context, opts downloadOption
955966
956967// downloadV1NoStream uses DownloadFileAttachmentLocal instead of DownloadAttachmentLocal.
957968func (c * chatServiceHandler ) downloadV1NoStream (ctx context.Context , opts downloadOptionsV1 ,
958- chatUI chat1.ChatUiInterface ) Reply {
969+ chatUI chat1.ChatUiInterface , notifyUI chat1. NotifyChatInterface ) Reply {
959970 c .chatUI .RegisterChatUI (chatUI )
960971 defer c .chatUI .DeregisterChatUI (chatUI )
961972 client , err := GetChatLocalClient (c .G ())
@@ -965,10 +976,21 @@ func (c *chatServiceHandler) downloadV1NoStream(ctx context.Context, opts downlo
965976 protocols := []rpc.Protocol {
966977 NewStreamUIProtocol (c .G ()),
967978 chat1 .ChatUiProtocol (c .chatUI ),
979+ chat1 .NotifyChatProtocol (notifyUI ),
968980 }
969981 if err := RegisterProtocolsWithContext (protocols , c .G ()); err != nil {
970982 return c .errReply (err )
971983 }
984+ cli , err := GetNotifyCtlClient (c .G ())
985+ if err != nil {
986+ return c .errReply (err )
987+ }
988+ channels := keybase1.NotificationChannels {
989+ Chatattachments : true ,
990+ }
991+ if err := cli .SetNotifications (context .TODO (), channels ); err != nil {
992+ return c .errReply (err )
993+ }
972994
973995 convID , rlimits , err := c .resolveAPIConvID (ctx , opts .ConversationID , opts .Channel )
974996 if err != nil {
0 commit comments