| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -16,7 +16,7 @@ import { SessionRightPanelWithDetails } from './SessionRightPanel';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import { SessionTheme } from '../../../state/ducks/SessionTheme';
 | 
					 | 
					 | 
					 | 
					import { SessionTheme } from '../../../state/ducks/SessionTheme';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import { DefaultTheme } from 'styled-components';
 | 
					 | 
					 | 
					 | 
					import { DefaultTheme } from 'styled-components';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import { SessionConversationMessagesList } from './SessionConversationMessagesList';
 | 
					 | 
					 | 
					 | 
					import { SessionConversationMessagesList } from './SessionConversationMessagesList';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import { LightboxGallery } from '../../LightboxGallery';
 | 
					 | 
					 | 
					 | 
					import { LightboxGallery, MediaItemType } from '../../LightboxGallery';
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import { Message } from '../../conversation/media-gallery/types/Message';
 | 
					 | 
					 | 
					 | 
					import { Message } from '../../conversation/media-gallery/types/Message';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import { AttachmentType } from '../../../types/Attachment';
 | 
					 | 
					 | 
					 | 
					import { AttachmentType } from '../../../types/Attachment';
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -121,12 +121,13 @@ export class SessionConversation extends React.Component<Props, State> {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    this.deleteSelectedMessages = this.deleteSelectedMessages.bind(this);
 | 
					 | 
					 | 
					 | 
					    this.deleteSelectedMessages = this.deleteSelectedMessages.bind(this);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    this.replyToMessage = this.replyToMessage.bind(this);
 | 
					 | 
					 | 
					 | 
					    this.replyToMessage = this.replyToMessage.bind(this);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    this.onClickAttachment = this.onClickAttachment.bind(this);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    this.getMessages = this.getMessages.bind(this);
 | 
					 | 
					 | 
					 | 
					    this.getMessages = this.getMessages.bind(this);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Keyboard navigation
 | 
					 | 
					 | 
					 | 
					    // Keyboard navigation
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    this.onKeyDown = this.onKeyDown.bind(this);
 | 
					 | 
					 | 
					 | 
					    this.onKeyDown = this.onKeyDown.bind(this);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    this.showLightBox = this.showLightBox.bind(this);
 | 
					 | 
					 | 
					 | 
					    this.renderLightBox = this.renderLightBox.bind(this);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const conversationModel = window.ConversationController.getOrThrow(
 | 
					 | 
					 | 
					 | 
					    const conversationModel = window.ConversationController.getOrThrow(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      this.state.conversationKey
 | 
					 | 
					 | 
					 | 
					      this.state.conversationKey
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -224,7 +225,7 @@ export class SessionConversation extends React.Component<Props, State> {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            {showMessageDetails && <> </>}
 | 
					 | 
					 | 
					 | 
					            {showMessageDetails && <> </>}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          </div>
 | 
					 | 
					 | 
					 | 
					          </div>
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          {lightBoxOptions?.media && this.showLightBox(lightBoxOptions)}
 | 
					 | 
					 | 
					 | 
					          {lightBoxOptions?.media && this.renderLightBox(lightBoxOptions)}
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          <div className="conversation-messages">
 | 
					 | 
					 | 
					 | 
					          <div className="conversation-messages">
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            <SessionConversationMessagesList {...messagesListProps} />
 | 
					 | 
					 | 
					 | 
					            <SessionConversationMessagesList {...messagesListProps} />
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -489,6 +490,7 @@ export class SessionConversation extends React.Component<Props, State> {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      getMessages: this.getMessages,
 | 
					 | 
					 | 
					 | 
					      getMessages: this.getMessages,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      replyToMessage: this.replyToMessage,
 | 
					 | 
					 | 
					 | 
					      replyToMessage: this.replyToMessage,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      doneInitialScroll: this.state.doneInitialScroll,
 | 
					 | 
					 | 
					 | 
					      doneInitialScroll: this.state.doneInitialScroll,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      onClickAttachment: this.onClickAttachment,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    };
 | 
					 | 
					 | 
					 | 
					    };
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -787,6 +789,20 @@ export class SessionConversation extends React.Component<Props, State> {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  private onClickAttachment(attachment: any, message: any) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    const lightBoxOptions = {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      media: [
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          objectURL: attachment.url,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          contentType: attachment.contentType,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          attachment,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        },
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      ],
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      attachment,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    };
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    this.setState({ lightBoxOptions });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					 | 
					 | 
					 | 
					  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  // ~~~~~~~~~~~ KEYBOARD NAVIGATION ~~~~~~~~~~~~
 | 
					 | 
					 | 
					 | 
					  // ~~~~~~~~~~~ KEYBOARD NAVIGATION ~~~~~~~~~~~~
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					 | 
					 | 
					 | 
					  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -830,11 +846,20 @@ export class SessionConversation extends React.Component<Props, State> {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // }
 | 
					 | 
					 | 
					 | 
					    // }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  private showLightBox(lightboxOptions: any) {
 | 
					 | 
					 | 
					 | 
					  private renderLightBox({
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const { media, attachment } = lightboxOptions;
 | 
					 | 
					 | 
					 | 
					    media,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const selectedIndex = media.findIndex(
 | 
					 | 
					 | 
					 | 
					    attachment,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      (mediaMessage: any) => mediaMessage.attachment.path === attachment.path
 | 
					 | 
					 | 
					 | 
					  }: {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    );
 | 
					 | 
					 | 
					 | 
					    media: Array<MediaItemType>;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    attachment: any;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  }) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    const selectedIndex =
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      media.length > 1
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        ? media.findIndex(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            (mediaMessage: any) =>
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					              mediaMessage.attachment.path === attachment.path
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          )
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        : 0;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return (
 | 
					 | 
					 | 
					 | 
					    return (
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      <LightboxGallery
 | 
					 | 
					 | 
					 | 
					      <LightboxGallery
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        media={media}
 | 
					 | 
					 | 
					 | 
					        media={media}
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -847,7 +872,7 @@ export class SessionConversation extends React.Component<Props, State> {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    );
 | 
					 | 
					 | 
					 | 
					    );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  // THIS DOES NOT DOWNLOAD ANYTHING!
 | 
					 | 
					 | 
					 | 
					  // THIS DOES NOT DOWNLOAD ANYTHING! it just saves it where the user wants
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  private downloadAttachment({
 | 
					 | 
					 | 
					 | 
					  private downloadAttachment({
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    attachment,
 | 
					 | 
					 | 
					 | 
					    attachment,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    message,
 | 
					 | 
					 | 
					 | 
					    message,
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -863,7 +888,7 @@ export class SessionConversation extends React.Component<Props, State> {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      attachment,
 | 
					 | 
					 | 
					 | 
					      attachment,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      document,
 | 
					 | 
					 | 
					 | 
					      document,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      getAbsolutePath: getAbsoluteAttachmentPath,
 | 
					 | 
					 | 
					 | 
					      getAbsolutePath: getAbsoluteAttachmentPath,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      timestamp: message.received_at || Date.now(),
 | 
					 | 
					 | 
					 | 
					      timestamp: message?.received_at || Date.now(),
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    });
 | 
					 | 
					 | 
					 | 
					    });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					 | 
					
 
 |