-
Notifications
You must be signed in to change notification settings - Fork 358
/
inbox_service_impl.go
229 lines (184 loc) · 8.51 KB
/
inbox_service_impl.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
/*
* WARNING! All changes made in this file will be lost!
* Created from 'scheme.tl' by 'mtprotoc'
*
* Copyright (c) 2021-present, Teamgram Studio (https://teamgram.io).
* All rights reserved.
*
* Author: teamgramio (teamgram.io@gmail.com)
*/
package service
import (
"context"
"github.com/teamgram/proto/mtproto"
"github.com/teamgram/teamgram-server/app/messenger/msg/inbox/inbox"
"github.com/teamgram/teamgram-server/app/messenger/msg/inbox/internal/core"
)
// InboxSendUserMessageToInbox
// inbox.sendUserMessageToInbox from_id:long peer_user_id:long message:InboxMessageData = Void;
func (s *Service) InboxSendUserMessageToInbox(ctx context.Context, request *inbox.TLInboxSendUserMessageToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.sendUserMessageToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxSendUserMessageToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.sendUserMessageToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxSendChatMessageToInbox
// inbox.sendChatMessageToInbox from_id:long peer_chat_id:long message:InboxMessageData = Void;
func (s *Service) InboxSendChatMessageToInbox(ctx context.Context, request *inbox.TLInboxSendChatMessageToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.sendChatMessageToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxSendChatMessageToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.sendChatMessageToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxSendUserMultiMessageToInbox
// inbox.sendUserMultiMessageToInbox from_id:long peer_user_id:long message:Vector<InboxMessageData> = Void;
func (s *Service) InboxSendUserMultiMessageToInbox(ctx context.Context, request *inbox.TLInboxSendUserMultiMessageToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.sendUserMultiMessageToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxSendUserMultiMessageToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.sendUserMultiMessageToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxSendChatMultiMessageToInbox
// inbox.sendChatMultiMessageToInbox from_id:long peer_chat_id:long message:Vector<InboxMessageData> = Void;
func (s *Service) InboxSendChatMultiMessageToInbox(ctx context.Context, request *inbox.TLInboxSendChatMultiMessageToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.sendChatMultiMessageToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxSendChatMultiMessageToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.sendChatMultiMessageToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxEditUserMessageToInbox
// inbox.editUserMessageToInbox from_id:long peer_user_id:long message:Message = Void;
func (s *Service) InboxEditUserMessageToInbox(ctx context.Context, request *inbox.TLInboxEditUserMessageToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.editUserMessageToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxEditUserMessageToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.editUserMessageToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxEditChatMessageToInbox
// inbox.editChatMessageToInbox from_id:long peer_chat_id:long message:Message = Void;
func (s *Service) InboxEditChatMessageToInbox(ctx context.Context, request *inbox.TLInboxEditChatMessageToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.editChatMessageToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxEditChatMessageToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.editChatMessageToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxDeleteMessagesToInbox
// inbox.deleteMessagesToInbox from_id:long id:Vector<long> = Void;
func (s *Service) InboxDeleteMessagesToInbox(ctx context.Context, request *inbox.TLInboxDeleteMessagesToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.deleteMessagesToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxDeleteMessagesToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.deleteMessagesToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxDeleteUserHistoryToInbox
// inbox.deleteUserHistoryToInbox flags:# from_id:long peer_user_id:long just_clear:flags.1?true max_id:int = Void;
func (s *Service) InboxDeleteUserHistoryToInbox(ctx context.Context, request *inbox.TLInboxDeleteUserHistoryToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.deleteUserHistoryToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxDeleteUserHistoryToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.deleteUserHistoryToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxDeleteChatHistoryToInbox
// inbox.deleteChatHistoryToInbox from_id:long peer_chat_id:long max_id:int = Void;
func (s *Service) InboxDeleteChatHistoryToInbox(ctx context.Context, request *inbox.TLInboxDeleteChatHistoryToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.deleteChatHistoryToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxDeleteChatHistoryToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.deleteChatHistoryToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxReadUserMediaUnreadToInbox
// inbox.readUserMediaUnreadToInbox from_id:long id:Vector<int> = Void;
func (s *Service) InboxReadUserMediaUnreadToInbox(ctx context.Context, request *inbox.TLInboxReadUserMediaUnreadToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.readUserMediaUnreadToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxReadUserMediaUnreadToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.readUserMediaUnreadToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxReadChatMediaUnreadToInbox
// inbox.readChatMediaUnreadToInbox from_id:long peer_chat_id:long id:Vector<int> = Void;
func (s *Service) InboxReadChatMediaUnreadToInbox(ctx context.Context, request *inbox.TLInboxReadChatMediaUnreadToInbox) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.readChatMediaUnreadToInbox - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxReadChatMediaUnreadToInbox(request)
if err != nil {
return nil, err
}
c.Infof("inbox.readChatMediaUnreadToInbox - reply: %s", r.DebugString())
return r, err
}
// InboxUpdateHistoryReaded
// inbox.updateHistoryReaded from_id:long peer_type:int peer_id:long max_id:int sender:long = Void;
func (s *Service) InboxUpdateHistoryReaded(ctx context.Context, request *inbox.TLInboxUpdateHistoryReaded) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.updateHistoryReaded - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxUpdateHistoryReaded(request)
if err != nil {
return nil, err
}
c.Infof("inbox.updateHistoryReaded - reply: %s", r.DebugString())
return r, err
}
// InboxUpdatePinnedMessage
// inbox.updatePinnedMessage flags:# user_id:long unpin:flags.1?true peer_type:int peer_id:long id:int dialog_message_id:long = Void;
func (s *Service) InboxUpdatePinnedMessage(ctx context.Context, request *inbox.TLInboxUpdatePinnedMessage) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.updatePinnedMessage - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxUpdatePinnedMessage(request)
if err != nil {
return nil, err
}
c.Infof("inbox.updatePinnedMessage - reply: %s", r.DebugString())
return r, err
}
// InboxUnpinAllMessages
// inbox.unpinAllMessages user_id:long auth_key_id:long peer_type:int peer_id:long = Void;
func (s *Service) InboxUnpinAllMessages(ctx context.Context, request *inbox.TLInboxUnpinAllMessages) (*mtproto.Void, error) {
c := core.New(ctx, s.svcCtx)
c.Infof("inbox.unpinAllMessages - metadata: %s, request: %s", c.MD.DebugString(), request.DebugString())
r, err := c.InboxUnpinAllMessages(request)
if err != nil {
return nil, err
}
c.Infof("inbox.unpinAllMessages - reply: %s", r.DebugString())
return r, err
}