mirror of
				https://gitlab.com/famedly/fluffychat.git
				synced 2025-11-04 06:17:26 +01:00 
			
		
		
		
	feat: Nicer mentions
This commit is contained in:
		
							parent
							
								
									9a74d0977b
								
							
						
					
					
						commit
						99bc8198e9
					
				@ -86,7 +86,7 @@ class ChatView extends StatelessWidget {
 | 
			
		||||
                                      outerContext: context,
 | 
			
		||||
                                      onMention: () => controller
 | 
			
		||||
                                              .sendController.text +=
 | 
			
		||||
                                          '${controller.room.directChatMatrixID} ',
 | 
			
		||||
                                          '${controller.room.getUserByMXIDSync(controller.room.directChatMatrixID).mention} ',
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  )
 | 
			
		||||
                              : () => VRouter.of(context)
 | 
			
		||||
@ -376,7 +376,7 @@ class ChatView extends StatelessWidget {
 | 
			
		||||
                                                          onMention: () => controller
 | 
			
		||||
                                                                  .sendController
 | 
			
		||||
                                                                  .text +=
 | 
			
		||||
                                                              '${event.senderId} ',
 | 
			
		||||
                                                              '${event.sender.mention} ',
 | 
			
		||||
                                                        ),
 | 
			
		||||
                                                      ),
 | 
			
		||||
                                                  unfold: controller.unfold,
 | 
			
		||||
 | 
			
		||||
@ -115,6 +115,7 @@ class InputBar extends StatelessWidget {
 | 
			
		||||
          ret.add({
 | 
			
		||||
            'type': 'user',
 | 
			
		||||
            'mxid': user.id,
 | 
			
		||||
            'mention': user.mention,
 | 
			
		||||
            'displayname': user.displayName,
 | 
			
		||||
            'avatar_url': user.avatarUrl?.toString(),
 | 
			
		||||
          });
 | 
			
		||||
@ -324,7 +325,7 @@ class InputBar extends StatelessWidget {
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
    if (suggestion['type'] == 'user') {
 | 
			
		||||
      insertText = suggestion['mxid'] + ' ';
 | 
			
		||||
      insertText = suggestion['mention'] + ' ';
 | 
			
		||||
      startText = replaceText.replaceAllMapped(
 | 
			
		||||
        RegExp(r'(\s|^)(@[-\w]+)$'),
 | 
			
		||||
        (Match m) => '${m[1]}$insertText',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user