@mtcute/core 0.26.1 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/highlevel/client.d.cts +3 -3
  2. package/highlevel/client.d.ts +3 -3
  3. package/highlevel/methods/chats/set-chat-color.cjs +5 -2
  4. package/highlevel/methods/chats/set-chat-color.d.cts +0 -2
  5. package/highlevel/methods/chats/set-chat-color.d.ts +0 -2
  6. package/highlevel/methods/chats/set-chat-color.js +5 -2
  7. package/highlevel/methods/contacts/add-contact.cjs +4 -2
  8. package/highlevel/methods/contacts/add-contact.d.cts +5 -1
  9. package/highlevel/methods/contacts/add-contact.d.ts +5 -1
  10. package/highlevel/methods/contacts/add-contact.js +4 -2
  11. package/highlevel/methods/contacts/set-contact-note.d.cts +9 -0
  12. package/highlevel/methods/contacts/set-contact-note.d.ts +9 -0
  13. package/highlevel/methods/forums/create-forum-topic.cjs +2 -2
  14. package/highlevel/methods/forums/create-forum-topic.js +3 -3
  15. package/highlevel/methods/forums/delete-forum-topic-history.cjs +9 -6
  16. package/highlevel/methods/forums/delete-forum-topic-history.js +10 -7
  17. package/highlevel/methods/forums/edit-forum-topic.cjs +6 -4
  18. package/highlevel/methods/forums/edit-forum-topic.d.cts +4 -0
  19. package/highlevel/methods/forums/edit-forum-topic.d.ts +4 -0
  20. package/highlevel/methods/forums/edit-forum-topic.js +7 -5
  21. package/highlevel/methods/forums/get-forum-topics-by-id.cjs +2 -2
  22. package/highlevel/methods/forums/get-forum-topics-by-id.js +3 -3
  23. package/highlevel/methods/forums/get-forum-topics.cjs +2 -2
  24. package/highlevel/methods/forums/get-forum-topics.js +3 -3
  25. package/highlevel/methods/forums/iter-forum-topics.cjs +1 -1
  26. package/highlevel/methods/forums/iter-forum-topics.js +2 -2
  27. package/highlevel/methods/messages/append-todo-list.cjs +1 -1
  28. package/highlevel/methods/messages/append-todo-list.js +1 -1
  29. package/highlevel/methods/messages/get-messages-unsafe.d.cts +1 -1
  30. package/highlevel/methods/messages/get-messages-unsafe.d.ts +1 -1
  31. package/highlevel/methods/messages/get-messages.d.cts +1 -1
  32. package/highlevel/methods/messages/get-messages.d.ts +1 -1
  33. package/highlevel/methods/messages/get-scheduled-messages.d.cts +1 -1
  34. package/highlevel/methods/messages/get-scheduled-messages.d.ts +1 -1
  35. package/highlevel/methods/premium/get-saved-star-gifts.cjs +1 -0
  36. package/highlevel/methods/premium/get-saved-star-gifts.d.cts +4 -0
  37. package/highlevel/methods/premium/get-saved-star-gifts.d.ts +4 -0
  38. package/highlevel/methods/premium/get-saved-star-gifts.js +1 -0
  39. package/highlevel/methods/users/set-emoji-status.cjs +2 -7
  40. package/highlevel/methods/users/set-emoji-status.js +2 -7
  41. package/highlevel/types/messages/message-action.cjs +15 -2
  42. package/highlevel/types/messages/message-action.d.cts +14 -1
  43. package/highlevel/types/messages/message-action.d.ts +14 -1
  44. package/highlevel/types/messages/message-action.js +15 -2
  45. package/highlevel/types/peers/chat-event/actions.cjs +1 -0
  46. package/highlevel/types/peers/chat-event/actions.js +1 -0
  47. package/highlevel/types/peers/chat.cjs +8 -2
  48. package/highlevel/types/peers/chat.js +8 -2
  49. package/highlevel/types/peers/forum-topic.cjs +10 -0
  50. package/highlevel/types/peers/forum-topic.d.cts +5 -0
  51. package/highlevel/types/peers/forum-topic.d.ts +5 -0
  52. package/highlevel/types/peers/forum-topic.js +10 -0
  53. package/highlevel/types/peers/full-user.cjs +4 -0
  54. package/highlevel/types/peers/full-user.d.cts +3 -0
  55. package/highlevel/types/peers/full-user.d.ts +3 -0
  56. package/highlevel/types/peers/full-user.js +4 -0
  57. package/highlevel/types/peers/user.cjs +12 -2
  58. package/highlevel/types/peers/user.d.cts +2 -0
  59. package/highlevel/types/peers/user.d.ts +2 -0
  60. package/highlevel/types/peers/user.js +12 -2
  61. package/highlevel/types/premium/saved-star-gift.cjs +4 -0
  62. package/highlevel/types/premium/saved-star-gift.d.cts +2 -0
  63. package/highlevel/types/premium/saved-star-gift.d.ts +2 -0
  64. package/highlevel/types/premium/saved-star-gift.js +4 -0
  65. package/highlevel/types/premium/stars-gift-unique.cjs +24 -0
  66. package/highlevel/types/premium/stars-gift-unique.d.cts +14 -0
  67. package/highlevel/types/premium/stars-gift-unique.d.ts +14 -0
  68. package/highlevel/types/premium/stars-gift-unique.js +24 -0
  69. package/highlevel/types/premium/stars-gift.cjs +4 -0
  70. package/highlevel/types/premium/stars-gift.d.cts +2 -0
  71. package/highlevel/types/premium/stars-gift.d.ts +2 -0
  72. package/highlevel/types/premium/stars-gift.js +4 -0
  73. package/highlevel/types/premium/stars-transaction.cjs +6 -0
  74. package/highlevel/types/premium/stars-transaction.d.cts +7 -0
  75. package/highlevel/types/premium/stars-transaction.d.ts +7 -0
  76. package/highlevel/types/premium/stars-transaction.js +6 -0
  77. package/highlevel/types/updates/history-read-update.cjs +2 -1
  78. package/highlevel/types/updates/history-read-update.js +2 -1
  79. package/highlevel/types/updates/user-typing-update.cjs +12 -0
  80. package/highlevel/types/updates/user-typing-update.d.cts +2 -0
  81. package/highlevel/types/updates/user-typing-update.d.ts +2 -0
  82. package/highlevel/types/updates/user-typing-update.js +12 -0
  83. package/network/network-manager.cjs +1 -1
  84. package/network/network-manager.js +1 -1
  85. package/network/session-connection.cjs +16 -4
  86. package/network/session-connection.js +16 -4
  87. package/package.json +2 -2
  88. package/utils/binary/compat.cjs +16 -2
  89. package/utils/binary/compat.js +16 -2
@@ -26,6 +26,10 @@ class StarGift {
26
26
  get isPremiumOnly() {
27
27
  return this.raw.requirePremium;
28
28
  }
29
+ /** Whether this gift includes a peer color that can be applied to user's profile */
30
+ get hasPeerColor() {
31
+ return this.raw.peerColorAvailable;
32
+ }
29
33
  /** Whether this gift is a unique gift */
30
34
  isUnique = false;
31
35
  /** Additional information for sold-out gifts */
@@ -141,6 +141,12 @@ class StarsTransaction {
141
141
  gift: new starsGiftUnique.StarGiftUnique(this.raw.stargift, this.peers),
142
142
  type: "star_gift_prepaid_upgrade"
143
143
  };
144
+ } else if (this.raw.stargiftDropOriginalDetails) {
145
+ return {
146
+ type: "star_gift_drop_details",
147
+ peer: peer$1,
148
+ gift: new starsGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
149
+ };
144
150
  } else {
145
151
  return {
146
152
  type: "star_gift_transfer",
@@ -30,6 +30,7 @@ import { StarGift } from './stars-gift.js';
30
30
  * - `ads_proceeds`: This transaction is proceeds from Telegram Ads
31
31
  * - `paid_search`: This transaction is a payment for a paid search
32
32
  * - `star_gift_prepaid_upgrade`: This transaction is for a star gift prepaid upgrade
33
+ * - `star_gift_drop_details`: This transaction is for dropping the original details of a star gift
33
34
  */
34
35
  export type StarsTransactionType = {
35
36
  type: 'unsupported';
@@ -174,6 +175,12 @@ export type StarsTransactionType = {
174
175
  peer: Peer;
175
176
  /** The upgraded gift */
176
177
  gift: StarGiftUnique;
178
+ } | {
179
+ type: 'star_gift_drop_details';
180
+ /** Related peer */
181
+ peer: Peer;
182
+ /** The dropped gift */
183
+ gift: StarGiftUnique;
177
184
  };
178
185
  export declare class StarsTransaction {
179
186
  readonly raw: tl.RawStarsTransaction;
@@ -30,6 +30,7 @@ import { StarGift } from './stars-gift.js';
30
30
  * - `ads_proceeds`: This transaction is proceeds from Telegram Ads
31
31
  * - `paid_search`: This transaction is a payment for a paid search
32
32
  * - `star_gift_prepaid_upgrade`: This transaction is for a star gift prepaid upgrade
33
+ * - `star_gift_drop_details`: This transaction is for dropping the original details of a star gift
33
34
  */
34
35
  export type StarsTransactionType = {
35
36
  type: 'unsupported';
@@ -174,6 +175,12 @@ export type StarsTransactionType = {
174
175
  peer: Peer;
175
176
  /** The upgraded gift */
176
177
  gift: StarGiftUnique;
178
+ } | {
179
+ type: 'star_gift_drop_details';
180
+ /** Related peer */
181
+ peer: Peer;
182
+ /** The dropped gift */
183
+ gift: StarGiftUnique;
177
184
  };
178
185
  export declare class StarsTransaction {
179
186
  readonly raw: tl.RawStarsTransaction;
@@ -134,6 +134,12 @@ class StarsTransaction {
134
134
  gift: new StarGiftUnique$2(this.raw.stargift, this.peers),
135
135
  type: "star_gift_prepaid_upgrade"
136
136
  };
137
+ } else if (this.raw.stargiftDropOriginalDetails) {
138
+ return {
139
+ type: "star_gift_drop_details",
140
+ peer,
141
+ gift: new StarGiftUnique$2(this.raw.stargift, this.peers)
142
+ };
137
143
  } else {
138
144
  return {
139
145
  type: "star_gift_transfer",
@@ -117,12 +117,13 @@ class HistoryReadUpdate {
117
117
  get threadId() {
118
118
  switch (this.raw._) {
119
119
  case "updateReadHistoryOutbox":
120
- case "updateReadHistoryInbox":
121
120
  case "updateReadChannelOutbox":
122
121
  case "updateReadChannelInbox":
123
122
  case "updateReadMonoForumInbox":
124
123
  case "updateReadMonoForumOutbox":
125
124
  return 0;
125
+ case "updateReadHistoryInbox":
126
+ return this.raw.topMsgId ?? 0;
126
127
  case "updateReadChannelDiscussionOutbox":
127
128
  case "updateReadChannelDiscussionInbox":
128
129
  return this.raw.topMsgId;
@@ -110,12 +110,13 @@ class HistoryReadUpdate {
110
110
  get threadId() {
111
111
  switch (this.raw._) {
112
112
  case "updateReadHistoryOutbox":
113
- case "updateReadHistoryInbox":
114
113
  case "updateReadChannelOutbox":
115
114
  case "updateReadChannelInbox":
116
115
  case "updateReadMonoForumInbox":
117
116
  case "updateReadMonoForumOutbox":
118
117
  return 0;
118
+ case "updateReadHistoryInbox":
119
+ return this.raw.topMsgId ?? 0;
119
120
  case "updateReadChannelDiscussionOutbox":
120
121
  case "updateReadChannelDiscussionInbox":
121
122
  return this.raw.topMsgId;
@@ -34,6 +34,17 @@ class UserTypingUpdate {
34
34
  return peerUtils.toggleChannelIdMark(this.raw.channelId);
35
35
  }
36
36
  }
37
+ /** ID of the thread/topic where the user is typing, if applicable */
38
+ get threadId() {
39
+ switch (this.raw._) {
40
+ case "updateUserTyping":
41
+ return this.raw.topMsgId ?? null;
42
+ case "updateChatUserTyping":
43
+ return null;
44
+ case "updateChannelUserTyping":
45
+ return this.raw.topMsgId ?? null;
46
+ }
47
+ }
37
48
  /**
38
49
  * Type of the chat where this event has occurred
39
50
  */
@@ -53,6 +64,7 @@ class UserTypingUpdate {
53
64
  get status() {
54
65
  switch (this.raw.action._) {
55
66
  case "sendMessageTypingAction":
67
+ case "sendMessageTextDraftAction":
56
68
  return "typing";
57
69
  case "sendMessageCancelAction":
58
70
  return "cancel";
@@ -20,6 +20,8 @@ export declare class UserTypingUpdate {
20
20
  * equal to {@link userId}
21
21
  */
22
22
  get chatId(): number;
23
+ /** ID of the thread/topic where the user is typing, if applicable */
24
+ get threadId(): number | null;
23
25
  /**
24
26
  * Type of the chat where this event has occurred
25
27
  */
@@ -20,6 +20,8 @@ export declare class UserTypingUpdate {
20
20
  * equal to {@link userId}
21
21
  */
22
22
  get chatId(): number;
23
+ /** ID of the thread/topic where the user is typing, if applicable */
24
+ get threadId(): number | null;
23
25
  /**
24
26
  * Type of the chat where this event has occurred
25
27
  */
@@ -27,6 +27,17 @@ class UserTypingUpdate {
27
27
  return toggleChannelIdMark(this.raw.channelId);
28
28
  }
29
29
  }
30
+ /** ID of the thread/topic where the user is typing, if applicable */
31
+ get threadId() {
32
+ switch (this.raw._) {
33
+ case "updateUserTyping":
34
+ return this.raw.topMsgId ?? null;
35
+ case "updateChatUserTyping":
36
+ return null;
37
+ case "updateChannelUserTyping":
38
+ return this.raw.topMsgId ?? null;
39
+ }
40
+ }
30
41
  /**
31
42
  * Type of the chat where this event has occurred
32
43
  */
@@ -46,6 +57,7 @@ class UserTypingUpdate {
46
57
  get status() {
47
58
  switch (this.raw.action._) {
48
59
  case "sendMessageTypingAction":
60
+ case "sendMessageTextDraftAction":
49
61
  return "typing";
50
62
  case "sendMessageCancelAction":
51
63
  return "cancel";
@@ -225,7 +225,7 @@ class NetworkManager {
225
225
  _: "initConnection",
226
226
  deviceModel,
227
227
  systemVersion: "1.0",
228
- appVersion: "0.26.1",
228
+ appVersion: "0.26.2",
229
229
  systemLangCode: "en",
230
230
  langPack: "",
231
231
  // "langPacks are for official apps only"
@@ -218,7 +218,7 @@ class NetworkManager {
218
218
  _: "initConnection",
219
219
  deviceModel,
220
220
  systemVersion: "1.0",
221
- appVersion: "0.26.1",
221
+ appVersion: "0.26.2",
222
222
  systemLangCode: "en",
223
223
  langPack: "",
224
224
  // "langPacks are for official apps only"
@@ -733,7 +733,7 @@ class SessionConnection extends persistentConnection.PersistentConnection {
733
733
  msgInfo.msgIds.length,
734
734
  reason
735
735
  );
736
- this._session.queuedResendReq.splice(0, 0, ...msgInfo.msgIds);
736
+ this._session.queuedResendReq.unshift(...msgInfo.msgIds);
737
737
  this._flushTimer.emitWhenIdle();
738
738
  break;
739
739
  case "state": {
@@ -748,7 +748,7 @@ class SessionConnection extends persistentConnection.PersistentConnection {
748
748
  utils.timers.clearTimeout(timer);
749
749
  this._session.pendingGetStateTimeouts.delete(msgId);
750
750
  }
751
- this._session.queuedStateReq.splice(0, 0, ...msgInfo.msgIds);
751
+ this._session.queuedStateReq.unshift(...msgInfo.msgIds);
752
752
  this._flushTimer.emitWhenIdle();
753
753
  break;
754
754
  }
@@ -884,7 +884,12 @@ class SessionConnection extends persistentConnection.PersistentConnection {
884
884
  return;
885
885
  }
886
886
  if (answerMsgId.isZero()) {
887
- this.log.debug("received message info for %l: message is still pending (status = %d)", msgId, status);
887
+ if (status & 64 && this._session.pendingMessages.has(msgId)) {
888
+ this.log.debug("received message info for %l: response is generated, but we have not received it yet! (status = %d)", msgId, status);
889
+ this._onMessageFailed(msgId, "response not received");
890
+ } else {
891
+ this.log.debug("received message info for %l: message is still pending (status = %d)", msgId, status);
892
+ }
888
893
  return;
889
894
  }
890
895
  this.log.debug("received message info for %l, and answer (%l) was already received", msgId, answerMsgId);
@@ -900,6 +905,9 @@ class SessionConnection extends persistentConnection.PersistentConnection {
900
905
  _onMsgsStateInfo(msg) {
901
906
  const info = this._session.pendingMessages.get(msg.reqMsgId);
902
907
  if (!info) {
908
+ if (this._session.recentOutgoingMsgIds.has(msg.reqMsgId)) {
909
+ return;
910
+ }
903
911
  this.log.warn("received msgs_state_info to unknown request %l", msg.reqMsgId);
904
912
  return;
905
913
  }
@@ -908,7 +916,11 @@ class SessionConnection extends persistentConnection.PersistentConnection {
908
916
  return;
909
917
  }
910
918
  this._session.pendingMessages.delete(msg.reqMsgId);
911
- this._session.pendingGetStateTimeouts.delete(msg.reqMsgId);
919
+ let timer;
920
+ if (timer = this._session.pendingGetStateTimeouts.get(msg.reqMsgId)) {
921
+ utils.timers.clearTimeout(timer);
922
+ this._session.pendingGetStateTimeouts.delete(msg.reqMsgId);
923
+ }
912
924
  this._onMessagesInfo(info.msgIds, msg.info);
913
925
  }
914
926
  _onFutureSalts(msg) {
@@ -726,7 +726,7 @@ class SessionConnection extends PersistentConnection {
726
726
  msgInfo.msgIds.length,
727
727
  reason
728
728
  );
729
- this._session.queuedResendReq.splice(0, 0, ...msgInfo.msgIds);
729
+ this._session.queuedResendReq.unshift(...msgInfo.msgIds);
730
730
  this._flushTimer.emitWhenIdle();
731
731
  break;
732
732
  case "state": {
@@ -741,7 +741,7 @@ class SessionConnection extends PersistentConnection {
741
741
  timers.clearTimeout(timer);
742
742
  this._session.pendingGetStateTimeouts.delete(msgId);
743
743
  }
744
- this._session.queuedStateReq.splice(0, 0, ...msgInfo.msgIds);
744
+ this._session.queuedStateReq.unshift(...msgInfo.msgIds);
745
745
  this._flushTimer.emitWhenIdle();
746
746
  break;
747
747
  }
@@ -877,7 +877,12 @@ class SessionConnection extends PersistentConnection {
877
877
  return;
878
878
  }
879
879
  if (answerMsgId.isZero()) {
880
- this.log.debug("received message info for %l: message is still pending (status = %d)", msgId, status);
880
+ if (status & 64 && this._session.pendingMessages.has(msgId)) {
881
+ this.log.debug("received message info for %l: response is generated, but we have not received it yet! (status = %d)", msgId, status);
882
+ this._onMessageFailed(msgId, "response not received");
883
+ } else {
884
+ this.log.debug("received message info for %l: message is still pending (status = %d)", msgId, status);
885
+ }
881
886
  return;
882
887
  }
883
888
  this.log.debug("received message info for %l, and answer (%l) was already received", msgId, answerMsgId);
@@ -893,6 +898,9 @@ class SessionConnection extends PersistentConnection {
893
898
  _onMsgsStateInfo(msg) {
894
899
  const info = this._session.pendingMessages.get(msg.reqMsgId);
895
900
  if (!info) {
901
+ if (this._session.recentOutgoingMsgIds.has(msg.reqMsgId)) {
902
+ return;
903
+ }
896
904
  this.log.warn("received msgs_state_info to unknown request %l", msg.reqMsgId);
897
905
  return;
898
906
  }
@@ -901,7 +909,11 @@ class SessionConnection extends PersistentConnection {
901
909
  return;
902
910
  }
903
911
  this._session.pendingMessages.delete(msg.reqMsgId);
904
- this._session.pendingGetStateTimeouts.delete(msg.reqMsgId);
912
+ let timer;
913
+ if (timer = this._session.pendingGetStateTimeouts.get(msg.reqMsgId)) {
914
+ timers.clearTimeout(timer);
915
+ this._session.pendingGetStateTimeouts.delete(msg.reqMsgId);
916
+ }
905
917
  this._onMessagesInfo(info.msgIds, msg.info);
906
918
  }
907
919
  _onFutureSalts(msg) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mtcute/core",
3
3
  "type": "module",
4
- "version": "0.26.1",
4
+ "version": "0.26.2",
5
5
  "description": "Type-safe library for MTProto (Telegram API)",
6
6
  "license": "MIT",
7
7
  "scripts": {},
@@ -10,7 +10,7 @@
10
10
  "@fuman/net": "0.0.15",
11
11
  "@fuman/utils": "0.0.15",
12
12
  "@mtcute/file-id": "^0.24.3",
13
- "@mtcute/tl": "^214.0.0",
13
+ "@mtcute/tl": "^216.0.0",
14
14
  "@mtcute/tl-runtime": "^0.24.3",
15
15
  "@types/events": "3.0.0",
16
16
  "long": "5.2.3"
@@ -56,6 +56,8 @@ function mapCompatStarGift(obj) {
56
56
  _: "starGiftUnique",
57
57
  giftId: Long.ZERO
58
58
  };
59
+ case "starGiftUnique_layer214":
60
+ return replaceType(obj, "starGiftUnique");
59
61
  case "starGift_layer202":
60
62
  case "starGift_layer206":
61
63
  case "starGift_layer209":
@@ -73,6 +75,12 @@ function mapCompatEmojiStatus(obj) {
73
75
  _: "emojiStatus",
74
76
  documentId: obj.documentId
75
77
  };
78
+ case "emojiStatusUntil_layer214":
79
+ return {
80
+ _: "emojiStatus",
81
+ documentId: obj.documentId,
82
+ until: obj.until
83
+ };
76
84
  default:
77
85
  return obj;
78
86
  }
@@ -89,6 +97,7 @@ function mapCompatMessageAction(obj) {
89
97
  switch (obj._) {
90
98
  case "messageActionStarGiftUnique_layer197":
91
99
  case "messageActionStarGiftUnique_layer202":
100
+ case "messageActionStarGiftUnique_layer214":
92
101
  return {
93
102
  ...obj,
94
103
  _: "messageActionStarGiftUnique",
@@ -167,12 +176,14 @@ function mapCompatObject(obj) {
167
176
  case "starGiftUnique_layer206":
168
177
  case "starGiftUnique_layer210":
169
178
  case "starGiftUnique_layer211":
179
+ case "starGiftUnique_layer214":
170
180
  case "starGift_layer202":
171
181
  case "starGift_layer206":
172
182
  case "starGift_layer209":
173
183
  case "starGift_layer211":
174
184
  return mapCompatStarGift(obj);
175
185
  case "emojiStatus_layer197":
186
+ case "emojiStatusUntil_layer214":
176
187
  return mapCompatEmojiStatus(obj);
177
188
  case "messageMediaDocument_layer197":
178
189
  return mapCompatMessageMedia(obj);
@@ -186,14 +197,15 @@ function mapCompatObject(obj) {
186
197
  case "messageActionStarGiftUnique_layer210":
187
198
  case "messageActionPaidMessagesPrice_layer203":
188
199
  case "messageActionSetChatTheme_layer211":
200
+ case "messageActionStarGiftUnique_layer214":
189
201
  return mapCompatMessageAction(obj);
190
202
  case "userFull_layer199":
191
203
  return replaceType(dropFields(obj, ["premiumGifts"]), "userFull");
192
- case "userFull_layer211":
193
- return replaceType(obj, "userFull");
194
204
  case "userFull_layer200":
195
205
  case "userFull_layer209":
196
206
  case "userFull_layer210":
207
+ case "userFull_layer211":
208
+ case "userFull_layer214":
197
209
  return replaceType(obj, "userFull");
198
210
  case "user_layer199":
199
211
  return {
@@ -224,6 +236,8 @@ function mapCompatObject(obj) {
224
236
  _: "storyItem",
225
237
  media: mapCompatMessageMedia(obj.media)
226
238
  };
239
+ case "premiumGiftOption_layer199":
240
+ return null;
227
241
  default:
228
242
  return obj;
229
243
  }
@@ -49,6 +49,8 @@ function mapCompatStarGift(obj) {
49
49
  _: "starGiftUnique",
50
50
  giftId: Long.ZERO
51
51
  };
52
+ case "starGiftUnique_layer214":
53
+ return replaceType(obj, "starGiftUnique");
52
54
  case "starGift_layer202":
53
55
  case "starGift_layer206":
54
56
  case "starGift_layer209":
@@ -66,6 +68,12 @@ function mapCompatEmojiStatus(obj) {
66
68
  _: "emojiStatus",
67
69
  documentId: obj.documentId
68
70
  };
71
+ case "emojiStatusUntil_layer214":
72
+ return {
73
+ _: "emojiStatus",
74
+ documentId: obj.documentId,
75
+ until: obj.until
76
+ };
69
77
  default:
70
78
  return obj;
71
79
  }
@@ -82,6 +90,7 @@ function mapCompatMessageAction(obj) {
82
90
  switch (obj._) {
83
91
  case "messageActionStarGiftUnique_layer197":
84
92
  case "messageActionStarGiftUnique_layer202":
93
+ case "messageActionStarGiftUnique_layer214":
85
94
  return {
86
95
  ...obj,
87
96
  _: "messageActionStarGiftUnique",
@@ -160,12 +169,14 @@ function mapCompatObject(obj) {
160
169
  case "starGiftUnique_layer206":
161
170
  case "starGiftUnique_layer210":
162
171
  case "starGiftUnique_layer211":
172
+ case "starGiftUnique_layer214":
163
173
  case "starGift_layer202":
164
174
  case "starGift_layer206":
165
175
  case "starGift_layer209":
166
176
  case "starGift_layer211":
167
177
  return mapCompatStarGift(obj);
168
178
  case "emojiStatus_layer197":
179
+ case "emojiStatusUntil_layer214":
169
180
  return mapCompatEmojiStatus(obj);
170
181
  case "messageMediaDocument_layer197":
171
182
  return mapCompatMessageMedia(obj);
@@ -179,14 +190,15 @@ function mapCompatObject(obj) {
179
190
  case "messageActionStarGiftUnique_layer210":
180
191
  case "messageActionPaidMessagesPrice_layer203":
181
192
  case "messageActionSetChatTheme_layer211":
193
+ case "messageActionStarGiftUnique_layer214":
182
194
  return mapCompatMessageAction(obj);
183
195
  case "userFull_layer199":
184
196
  return replaceType(dropFields(obj, ["premiumGifts"]), "userFull");
185
- case "userFull_layer211":
186
- return replaceType(obj, "userFull");
187
197
  case "userFull_layer200":
188
198
  case "userFull_layer209":
189
199
  case "userFull_layer210":
200
+ case "userFull_layer211":
201
+ case "userFull_layer214":
190
202
  return replaceType(obj, "userFull");
191
203
  case "user_layer199":
192
204
  return {
@@ -217,6 +229,8 @@ function mapCompatObject(obj) {
217
229
  _: "storyItem",
218
230
  media: mapCompatMessageMedia(obj.media)
219
231
  };
232
+ case "premiumGiftOption_layer199":
233
+ return null;
220
234
  default:
221
235
  return obj;
222
236
  }