mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-03 19:54:12 +00:00 
			
		
		
		
	Open conversations in their context
This commit is contained in:
		@@ -111,9 +111,15 @@ abstract class MainController extends State<MainRoute> {
 | 
			
		||||
  void openCurrentUserPage() => this.openUserPage(userID());
 | 
			
		||||
 | 
			
		||||
  /// Open a specific group page specified by its [groupID]
 | 
			
		||||
  void openGroup(int groupID) => pushPage(PageInfo(
 | 
			
		||||
  ///
 | 
			
		||||
  /// [conversationID] is an optional parameter specifying a conversation
 | 
			
		||||
  /// that should be opened instead of posts thread
 | 
			
		||||
  void openGroup(int groupID, {int conversationID}) => pushPage(PageInfo(
 | 
			
		||||
      type: PageType.GROUP_PAGE,
 | 
			
		||||
      child: GroupPageScreen(groupID: groupID),
 | 
			
		||||
      child: GroupPageScreen(
 | 
			
		||||
        groupID: groupID,
 | 
			
		||||
        conversationID: conversationID,
 | 
			
		||||
      ),
 | 
			
		||||
      id: groupID));
 | 
			
		||||
 | 
			
		||||
  /// Display the list of friends of current user
 | 
			
		||||
@@ -146,8 +152,17 @@ abstract class MainController extends State<MainRoute> {
 | 
			
		||||
      pushPage(PageInfo(
 | 
			
		||||
          child: w, hideNavBar: hideNavBar, canShowAsDialog: canShowAsDialog));
 | 
			
		||||
 | 
			
		||||
  /// Open a conversation in its context (in group page for group conversations)
 | 
			
		||||
  void openConversation(Conversation conv) {
 | 
			
		||||
    if (conv.isGroupConversation)
 | 
			
		||||
      openGroup(conv.groupID, conversationID: conv.id);
 | 
			
		||||
    else
 | 
			
		||||
      openConversationById(conv.id);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /// Open a conversation
 | 
			
		||||
  void openConversation(int convID, {fullScreen: false}) => pushPage(PageInfo(
 | 
			
		||||
  void openConversationById(int convID, {fullScreen: false}) =>
 | 
			
		||||
      pushPage(PageInfo(
 | 
			
		||||
        type: PageType.CONVERSATION_PAGE,
 | 
			
		||||
        id: convID,
 | 
			
		||||
        child: ConversationRoute(conversationID: convID),
 | 
			
		||||
 
 | 
			
		||||
@@ -90,12 +90,12 @@ class _TabletRouteState extends MainController {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void openConversation(int convID, {fullScreen = false}) {
 | 
			
		||||
  void openConversationById(int convID, {fullScreen = false}) {
 | 
			
		||||
    if (!fullScreen) {
 | 
			
		||||
      popUntilMainRoute();
 | 
			
		||||
      _conversationsKey.currentState.openConversations(convID);
 | 
			
		||||
    } else
 | 
			
		||||
      super.openConversation(convID, fullScreen: fullScreen);
 | 
			
		||||
      super.openConversationById(convID, fullScreen: fullScreen);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user