@@ -70,6 +70,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
7070 protected siteId : string ;
7171 protected currentUserId : number ;
7272 protected conversationId : number ;
73+ protected discussionUserId : number ;
7374 protected newMessagesObserver : any ;
7475 protected pushObserver : any ;
7576 protected appResumeSubscription : any ;
@@ -89,7 +90,9 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
8990 this . loadingString = translate . instant ( 'core.loading' ) ;
9091 this . siteId = sitesProvider . getCurrentSiteId ( ) ;
9192 this . currentUserId = sitesProvider . getCurrentSiteUserId ( ) ;
93+ // Conversation to load.
9294 this . conversationId = navParams . get ( 'conversationId' ) || false ;
95+ this . discussionUserId = ! this . conversationId && ( navParams . get ( 'discussionUserId' ) || false ) ;
9396
9497 // Update conversations when new message is received.
9598 this . newMessagesObserver = eventsProvider . on ( AddonMessagesProvider . NEW_MESSAGE_EVENT , ( data ) => {
@@ -213,9 +216,9 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
213216 * Component loaded.
214217 */
215218 ngOnInit ( ) : void {
216- if ( this . conversationId ) {
219+ if ( this . conversationId || this . discussionUserId ) {
217220 // There is a discussion to load, open the discussion in a new state.
218- this . gotoConversation ( this . conversationId ) ;
221+ this . gotoConversation ( this . conversationId , this . discussionUserId ) ;
219222 }
220223
221224 this . fetchData ( ) . then ( ( ) => {
0 commit comments