WEBVTT

00:00.480 --> 00:02.840
Sorry everyone in this video.

00:03.040 --> 00:07.320
Let's continue with conversation feature.

00:07.760 --> 00:08.240
Okay.

00:08.560 --> 00:13.360
In this video we will use the Create Private group.

00:14.000 --> 00:14.480
Okay.

00:15.840 --> 00:19.240
Actually create private conversation.

00:19.800 --> 00:21.320
Let me show you how it works.

00:21.360 --> 00:28.920
Firstly we need to create a participant and easy group right here will be false because this group will

00:28.920 --> 00:29.440
be formed.

00:29.480 --> 00:32.640
We don't list anything right here.

00:33.200 --> 00:33.440
Okay.

00:33.480 --> 00:35.080
Actually, we need the last message.

00:35.080 --> 00:35.480
Right?

00:37.080 --> 00:40.320
But I will show you how we can do that later.

00:40.480 --> 00:40.960
Right now.

00:41.000 --> 00:42.600
Don't care about last message.

00:45.760 --> 00:46.160
Okay.

00:46.160 --> 00:50.480
Practice one and is work well.

00:51.720 --> 00:53.200
Let me show you the flow.

00:54.040 --> 00:55.560
If you take a look at the message.

00:56.320 --> 01:05.660
When I click into No conversation or glued inside a frame or something like that.

01:05.700 --> 01:14.780
Okay, I want it will create for me the conversation right when I click into the frame, it will create

01:14.780 --> 01:17.060
the conversation.

01:19.340 --> 01:27.660
And here I will create the conversation also, but it not create the conversation immediately is that

01:28.380 --> 01:32.460
we will write a little bit of checking over here.

01:33.300 --> 01:34.140
We will check.

01:36.420 --> 01:42.700
Me and my friend had a conversation or not.

01:43.340 --> 01:52.420
If we already have a conversation before we will return directly to us and if not, we need to create

01:52.420 --> 01:53.900
a new conversation.

01:53.940 --> 01:56.540
Okay, start the flow.

01:57.100 --> 01:59.120
So let create us.

02:01.680 --> 02:02.320
In here.

02:03.640 --> 02:06.960
This reality of I will duplicate.

02:07.200 --> 02:08.640
And I will create a.

02:10.960 --> 02:15.960
Create private conversation.

02:18.560 --> 02:21.880
With you to be here.

02:24.520 --> 02:29.640
And create private conversation.

02:29.640 --> 02:31.760
Digital right here.

02:31.760 --> 02:32.480
What we need.

02:33.920 --> 02:35.560
We need a participant.

02:35.960 --> 02:36.320
Right.

02:36.360 --> 02:36.840
We need what?

02:38.960 --> 02:41.880
Are we missing?

02:41.920 --> 02:42.360
Okay.

02:42.360 --> 02:44.600
We only need one participant.

02:45.840 --> 02:46.320
Okay.

02:46.360 --> 02:51.120
We will need a my friend ID right.

02:51.120 --> 02:52.040
Will be my friend.

02:52.400 --> 02:53.480
For example, right here.

02:54.120 --> 02:55.680
The ID of this.

02:55.920 --> 02:56.200
Uh.

02:57.670 --> 02:58.190
Okay.

02:58.910 --> 03:04.590
We need to do and we need is group will be fun.

03:04.630 --> 03:04.950
Okay.

03:04.950 --> 03:14.670
So for that reason, I think we we just need here and we need to add a little bit objective is not empty.

03:15.430 --> 03:18.710
And this will add a.

03:21.350 --> 03:28.430
Class and go here and I will copy and paste over here.

03:29.390 --> 03:31.510
Create private.

03:41.230 --> 03:47.150
So here we will in order to create private we will need a little.

03:47.710 --> 03:50.270
And we need a current user okay.

03:50.790 --> 03:55.350
Because we need a me and my friend right.

04:01.130 --> 04:03.250
Although we need to find exited.

04:06.690 --> 04:10.210
The conversation right.

04:11.490 --> 04:12.490
We do away.

04:12.530 --> 04:14.730
We need to inject that.

04:15.370 --> 04:18.810
Let me be a little bit.

04:26.370 --> 04:26.650
Okay.

04:26.650 --> 04:28.450
Let me copy the constructor over here.

04:29.730 --> 04:30.810
Headers here.

04:31.890 --> 04:35.890
Inject model session.

04:46.370 --> 04:46.810
Over here.

04:46.850 --> 04:47.290
Okay.

04:48.610 --> 04:50.450
Let me show you how it can be fine.

04:50.490 --> 04:57.830
We need to await this dot position model Photo Profile one.

04:58.270 --> 04:58.750
Okay.

04:59.830 --> 05:02.630
And we need to add a little bit over here.

05:03.190 --> 05:09.310
Firstly we need to boost the is work with before right.

05:09.310 --> 05:10.790
Because this is the private.

05:11.150 --> 05:14.110
So for the Is group but based phone.

05:14.590 --> 05:17.070
And we need to try the one.

05:19.910 --> 05:20.470
Okay.

05:20.710 --> 05:23.470
So here we will use the own method.

05:25.950 --> 05:26.910
Uh right now.

05:28.990 --> 05:33.550
With the current user dot add.

05:36.790 --> 05:37.270
And.

05:42.150 --> 05:42.910
Put an arrow.

05:50.870 --> 05:51.550
Over here.

05:52.190 --> 05:52.550
Okay.

05:52.550 --> 05:56.410
We need to Information, right?

05:56.770 --> 06:05.210
Because when I look right here, I want to know A and B has a conversation or not.

06:05.250 --> 06:06.890
So for a reason we need to check.

06:09.130 --> 06:10.330
All right.

06:10.330 --> 06:11.730
We need to check all the brass.

06:12.370 --> 06:14.370
So for a reason we will check a little bit.

06:14.690 --> 06:20.570
And if it already exists conversation I will return directly last.

06:21.130 --> 06:24.610
And if not we need to create and return a new.

06:28.770 --> 06:29.250
Okay.

06:29.250 --> 06:33.490
If not, we will return.

06:34.250 --> 06:38.450
Or we can call the conversation.

06:50.210 --> 07:00.430
Piece we wafer and proxy statement will be current user ID and participant added over here.

07:01.630 --> 07:02.150
Okay.

07:02.950 --> 07:09.430
And we will return conversation dot save methods like that.

07:12.910 --> 07:13.430
Okay.

07:13.870 --> 07:26.550
Now let's make this go to the conversation controller and create a method conversation slot private

07:28.150 --> 07:28.710
okay.

07:29.110 --> 07:40.030
And create private over here and create private method and put the current users.

07:49.950 --> 07:54.930
Over here And create private.

08:01.010 --> 08:01.890
Maxwell.

08:02.970 --> 08:03.210
Uh.

08:07.610 --> 08:10.530
Maxwell will use the authentication.

08:17.210 --> 08:21.250
Now, let's open the postman and test it.

08:48.770 --> 08:50.450
Here, I will duplicate the command.

08:53.160 --> 08:56.160
And change the follow into conversion.

08:58.600 --> 09:06.560
And right here let me rename it to create conversion for a private conversation.

09:06.960 --> 09:07.440
Okay.

09:10.920 --> 09:15.160
Let me change into conversations.

09:15.640 --> 09:16.120
Okay.

09:18.000 --> 09:22.200
And inside the bodies we need to do the JSON with.

09:27.240 --> 09:27.680
Okay.

09:27.680 --> 09:28.040
So.

09:30.720 --> 09:34.560
I okay with the ID of the user.

09:35.120 --> 09:38.600
We want to create the private group.

09:38.880 --> 09:40.560
We want to send a message okay.

09:40.840 --> 09:43.280
For example right here I will log in.

09:46.200 --> 09:50.700
With the account I Zandra here.

09:51.500 --> 09:53.260
Uh, we need to start the server.

10:03.340 --> 10:07.900
And, uh, in that time, I will go to the goodie bag.

10:42.540 --> 10:45.140
Now, let me, uh, say.

10:47.780 --> 10:48.180
Um.

10:48.180 --> 10:49.960
I'm gonna send a request.

10:50.960 --> 10:51.320
Oh.

10:55.160 --> 10:55.680
Okay.

10:55.680 --> 10:59.480
We have an error from the last message.

11:06.640 --> 11:08.360
Uh, let me double check.

11:15.200 --> 11:16.920
These are conversion.

11:20.760 --> 11:21.760
Schema.

11:23.960 --> 11:25.600
Or make sure we vote.

11:27.960 --> 11:28.680
Over here.

11:31.840 --> 11:32.480
Very good.

11:32.520 --> 11:33.000
All right.

11:37.040 --> 11:37.680
Message.

11:48.140 --> 11:48.700
Okay.

11:57.060 --> 11:58.180
Now let me say.

12:00.780 --> 12:03.100
I will side with the account.

12:09.740 --> 12:12.980
And boost authorization type over here.

12:13.460 --> 12:13.900
Okay.

12:13.940 --> 12:15.420
This is my account.

12:15.660 --> 12:21.020
And I will create a conversation between the Android users.

12:25.460 --> 12:26.660
With this account.

12:26.820 --> 12:27.420
Okay.

12:27.460 --> 12:34.060
Zone one, let me copy and click on authorization.

12:34.580 --> 12:35.140
Oh, sorry.

12:35.660 --> 12:38.780
Let's click on the vulnerable area over here.

12:39.660 --> 12:40.140
Okay.

12:40.660 --> 12:41.580
And let me say.

12:43.740 --> 12:46.680
Um, let us Absolutely not.

12:47.760 --> 12:50.560
We already have a bit of roll over here.

12:56.560 --> 12:57.280
Korea.

12:57.320 --> 12:57.760
Korea.

12:57.800 --> 12:58.560
Private.

13:02.080 --> 13:02.800
Oh, sorry.

13:03.280 --> 13:05.320
We should put the private over here.

13:05.840 --> 13:06.360
Okay.

13:06.960 --> 13:17.520
Let me say right here, you can say we already have the data between me and my friend over here, right?

13:18.480 --> 13:20.360
Me and my friend.

13:21.120 --> 13:28.960
And, uh, of course, right now, we need the one information in here.

13:29.400 --> 13:31.360
Let me open the schema.

13:32.160 --> 13:35.920
We need to know what is the owner of the conversation.

13:36.120 --> 13:36.440
Okay.

13:36.480 --> 13:46.070
For example, inside a group chat, we want to know what is the owner and only the owner can, delete

13:46.070 --> 13:48.630
entire conversation, right?

13:49.590 --> 13:54.870
So for that reason, in this case, I will provide one more view.

13:57.870 --> 14:05.590
On on Ruby user document also and make sure we will does.

14:12.510 --> 14:13.030
Okay.

14:13.470 --> 14:26.190
And when I am a current user I'm a when I create a row I want the current user will be the owner okay

14:26.910 --> 14:31.390
the the here it means who code.

14:33.550 --> 14:36.710
Is creates this row okay.

14:36.870 --> 14:38.670
So this will mean.

14:42.110 --> 14:46.130
I will go up And click on Create Private.

14:47.090 --> 14:47.490
Okay.

14:47.530 --> 14:52.730
Actually, private don't need to know what is the owner.

14:53.090 --> 14:53.610
Okay.

14:53.930 --> 14:58.370
So for that reason right here we can boost this.

14:58.370 --> 15:00.490
It will be optional.

15:01.170 --> 15:04.690
And we need to change it to Google Group owner.

15:05.130 --> 15:05.610
Okay.

15:06.370 --> 15:07.730
Only later.

15:08.210 --> 15:12.410
Only the group with a zero here will be true.

15:12.770 --> 15:14.930
We will boost the group owner.

15:15.690 --> 15:16.170
Okay.

15:16.650 --> 15:18.690
That is not about the group owner.

15:18.690 --> 15:19.370
That's me.

15:19.890 --> 15:20.450
So what?

15:20.450 --> 15:24.890
Right now we already have a successfully owner participant.

15:25.250 --> 15:30.090
And we already got the me and my friend, right?

15:30.650 --> 15:34.690
And each group here will be for so very very good.

15:38.370 --> 15:41.570
And that's for a video.

15:41.850 --> 15:43.690
So I will see you in the next one.
