@@ -180,6 +180,7 @@ const sendAndStoreMessage = async (channelId: string, content?: string) => {
180180 if ( ! user ) return ;
181181
182182 const localMessage : Message = {
183+ buttons : [ ] ,
183184 id : tempMessageId ,
184185 tempId : tempMessageId ,
185186 silent : isSilent ,
@@ -204,6 +205,7 @@ const sendAndStoreMessage = async (channelId: string, content?: string) => {
204205 replyToMessage : { ...m }
205206 } ) ) || [ ] ,
206207 createdBy : {
208+ bot : false ,
207209 profile : {
208210 font : user . profile ?. font
209211 } ,
@@ -216,10 +218,11 @@ const sendAndStoreMessage = async (channelId: string, content?: string) => {
216218 }
217219 } ;
218220
219- ! properties ?. moreBottomToLoad &&
221+ if ( ! properties ?. moreBottomToLoad ) {
220222 setMessages ( {
221223 [ channelId ] : sliceBeginning ( [ ...messages [ channelId ] ! , localMessage ] )
222224 } ) ;
225+ }
223226
224227 const onUploadProgress = ( percent : number , speed ?: string ) => {
225228 const messageIndex = messages [ channelId ] ! . findIndex (
@@ -232,9 +235,6 @@ const sendAndStoreMessage = async (channelId: string, content?: string) => {
232235 } ) ;
233236 } ;
234237
235- const isImage = properties ?. attachment ?. file . type ?. startsWith ( "image/" ) ;
236- const isMoreThan12MB = file && file . size > 12 * 1024 * 1024 ;
237-
238238 const shouldUploadToGoogleDrive =
239239 properties ?. attachment ?. uploadTo === "google_drive" ;
240240 const shouldUploadToNerimityCdn =
@@ -340,33 +340,39 @@ const sendAndStoreMessage = async (channelId: string, content?: string) => {
340340 ) ;
341341
342342 if ( ! message ) {
343- ! properties ?. moreBottomToLoad &&
343+ if ( ! properties ?. moreBottomToLoad ) {
344344 setMessages ( channelId , index ! , "sentStatus" , MessageSentStatus . FAILED ) ;
345+ }
345346 return ;
346347 }
347348 message . tempId = tempMessageId ;
348349
349- ! properties ?. moreBottomToLoad &&
350+ if ( ! properties ?. moreBottomToLoad ) {
350351 setMessages ( channelId , index ! , reconcile ( message , { key : "tempId" } ) ) ;
352+ }
351353} ;
352354
353355const pushMessage = ( channelId : string , message : Message ) => {
354356 if ( ! messages [ channelId ] ) return ;
355357 const channelProperties = useChannelProperties ( ) ;
356358 const properties = channelProperties . get ( channelId ) ;
357- ! properties ?. moreBottomToLoad &&
359+ if ( ! properties ?. moreBottomToLoad ) {
358360 setMessages ( {
359361 [ channelId ] : sliceBeginning ( [ ...messages [ channelId ] ! , message ] )
360362 } ) ;
363+ }
361364} ;
362365
363366const pushFailedMessage = ( channelId : string , content : string ) => {
364367 pushMessage ( channelId , {
365368 channelId : channelId ,
366369 createdAt : Date . now ( ) ,
370+ buttons : [ ] ,
371+ replyMessages : [ ] ,
367372 createdBy : {
368373 username : "Nerimity" ,
369374 tag : "owo" ,
375+ bot : true ,
370376 badges : 0 ,
371377 hexColor : "0" ,
372378 id : "0"
0 commit comments