@@ -27,6 +27,7 @@ import {
2727import type { RawBodyRange } from '../../types/BodyRange' ;
2828import { LONG_ATTACHMENT_LIMIT } from '../../types/Message' ;
2929import { PaymentEventKind } from '../../types/Payment' ;
30+ import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent' ;
3031import type {
3132 ConversationAttributesType ,
3233 MessageAttributesType ,
@@ -78,6 +79,7 @@ import {
7879 isChangeNumberNotification ,
7980 isJoinedSignalNotification ,
8081 isTitleTransitionNotification ,
82+ isMessageRequestResponse ,
8183} from '../../state/selectors/message' ;
8284import * as Bytes from '../../Bytes' ;
8385import { canBeSynced as canPreferredReactionEmojiBeSynced } from '../../reactions/preferredReactionEmoji' ;
@@ -181,7 +183,7 @@ export class BackupExportStream extends Readable {
181183
182184 // Map from custom color uuid to an index in accountSettings.customColors
183185 // array.
184- private customColorIdByUuid = new Map < string , number > ( ) ;
186+ private customColorIdByUuid = new Map < string , Long > ( ) ;
185187
186188 public run ( backupLevel : BackupLevel ) : void {
187189 drop (
@@ -1328,6 +1330,31 @@ export class BackupExportStream extends Readable {
13281330 return { kind : NonBubbleResultKind . Directionless , patch } ;
13291331 }
13301332
1333+ if ( isMessageRequestResponse ( message ) ) {
1334+ const { messageRequestResponseEvent : event } = message ;
1335+ if ( event == null ) {
1336+ return { kind : NonBubbleResultKind . Drop } ;
1337+ }
1338+
1339+ let type : Backups . SimpleChatUpdate . Type ;
1340+ const { Type } = Backups . SimpleChatUpdate ;
1341+ switch ( event ) {
1342+ case MessageRequestResponseEvent . ACCEPT :
1343+ case MessageRequestResponseEvent . BLOCK :
1344+ case MessageRequestResponseEvent . UNBLOCK :
1345+ return { kind : NonBubbleResultKind . Drop } ;
1346+ case MessageRequestResponseEvent . SPAM :
1347+ type = Type . REPORTED_SPAM ;
1348+ break ;
1349+ default :
1350+ throw missingCaseError ( event ) ;
1351+ }
1352+
1353+ updateMessage . simpleUpdate = { type } ;
1354+
1355+ return { kind : NonBubbleResultKind . Directionless , patch } ;
1356+ }
1357+
13311358 if ( isDeliveryIssue ( message ) ) {
13321359 updateMessage . simpleUpdate = {
13331360 type : Backups . SimpleChatUpdate . Type . BAD_DECRYPT ,
@@ -2278,7 +2305,7 @@ export class BackupExportStream extends Readable {
22782305
22792306 const result = new Array < Backups . ChatStyle . ICustomChatColor > ( ) ;
22802307 for ( const [ uuid , color ] of Object . entries ( customColors . colors ) ) {
2281- const id = result . length ;
2308+ const id = Long . fromNumber ( result . length ) ;
22822309 this . customColorIdByUuid . set ( uuid , id ) ;
22832310
22842311 const start = hslToRGBInt ( color . start . hue , color . start . saturation ) ;
0 commit comments