WEBVTT

00:00.320 --> 00:01.880
Hi everyone.

00:01.920 --> 00:05.080
Right now we already completed the conversation.

00:05.480 --> 00:09.320
In this video, let's go to the message and write the survey.

00:09.760 --> 00:10.240
Okay.

00:10.840 --> 00:14.520
The first survey we will send a message.

00:14.520 --> 00:17.320
Now you can say right here okay.

00:17.360 --> 00:20.240
Firstly we will get all the message in conversation.

00:20.840 --> 00:24.440
I will do that in later okay.

00:25.720 --> 00:32.680
Right now let's focus into the send a message to conversation okay.

00:32.800 --> 00:34.400
With the conversation okay.

00:34.440 --> 00:35.560
We need the conversation.

00:35.560 --> 00:39.200
I need to know the conversation.

00:39.200 --> 00:40.480
We want to send a message.

00:40.480 --> 00:40.960
Right.

00:41.760 --> 00:43.560
So let's focus on that.

00:45.800 --> 00:51.880
Below I will create a little I will rename it a little bit will be send message.

00:54.080 --> 00:54.600
Okay.

00:54.640 --> 01:02.650
And right here inside the create a message little I will rename send message over here.

01:04.250 --> 01:06.930
And send message with your.

01:07.090 --> 01:17.890
Now let's see what we need to, uh, to to property inside the send message a little bit about the schema.

01:19.010 --> 01:20.970
Firstly we need the conversation.

01:21.010 --> 01:26.970
The conversation right here will be come from the ID right from the ID.

01:27.210 --> 01:32.170
So we don't need to, uh, create a detail for that.

01:33.050 --> 01:34.250
And the sender right here.

01:34.250 --> 01:38.810
The sender right here is the current user already logged in.

01:39.210 --> 01:40.090
We don't need that.

01:40.090 --> 01:43.690
Also, we need a test for sure.

01:48.130 --> 01:50.170
We need a media file.

01:50.690 --> 01:51.210
Okay.

01:52.210 --> 01:52.850
We will.

01:54.210 --> 01:54.530
Um.

01:57.170 --> 01:57.890
All right.

01:58.970 --> 02:01.290
Uh, media type over here, right?

02:07.330 --> 02:08.530
Uh, let's see what we did.

02:10.450 --> 02:10.850
Uh.

02:12.970 --> 02:18.490
We, uh, don't need to sit by right now, okay?

02:18.490 --> 02:21.570
We already test and media files.

02:22.410 --> 02:24.690
Let me show you right here.

02:24.690 --> 02:25.090
We will.

02:25.090 --> 02:26.290
Is not empty.

02:27.490 --> 02:34.450
And right here we basically optional and paste.

02:34.850 --> 02:35.490
All right?

02:35.530 --> 02:35.850
Okay.

02:35.850 --> 02:36.650
We don't need to.

02:37.010 --> 02:40.970
We just need to check box paste the message service.

02:40.970 --> 02:42.930
Let me rename.

02:45.010 --> 02:47.970
Removes the query a message little.

02:51.290 --> 02:51.810
Okay.

02:52.490 --> 02:55.930
Let me destruct.

02:55.970 --> 02:56.930
Turin does.

03:08.060 --> 03:08.580
Okay.

03:09.060 --> 03:19.940
Now let's say firstly we need to inject the message model inside the service.

03:21.980 --> 03:25.740
Let me try to open the conversation and copy that.

03:31.380 --> 03:32.340
Would over here.

03:44.500 --> 03:45.020
Sorry.

03:46.300 --> 03:46.860
Message.

03:51.900 --> 03:53.220
Versus model.

03:59.460 --> 04:00.950
Let me remove the user.

04:00.950 --> 04:04.950
So maybe we will need that later.

04:06.230 --> 04:06.710
Okay.

04:06.750 --> 04:09.230
We already inject the message model.

04:10.230 --> 04:15.750
And right now let's see how we can create the same message.

04:16.750 --> 04:17.350
Okay.

04:18.110 --> 04:22.630
Right now which are the two creators.

04:23.310 --> 04:35.870
As usual this dot message model we will use the new operator and boost the model over here.

04:40.550 --> 04:44.830
Now you can say right here we have a bit up for you.

04:45.590 --> 04:50.710
If you say right here we need the convert session.

04:51.350 --> 04:51.750
Okay.

04:51.790 --> 05:00.920
So for the reason in here we need to put one more session ID Street rough.

05:01.880 --> 05:07.960
So for this conversation, I'm over here.

05:08.680 --> 05:10.040
Not the first one.

05:11.480 --> 05:14.280
And we need a center.

05:14.640 --> 05:15.520
What is the center?

05:15.560 --> 05:18.520
The center will be called from the current user.

05:18.560 --> 05:19.080
Right?

05:29.640 --> 05:33.720
And center will be called user ID.

05:37.800 --> 05:38.800
We need a test.

05:39.320 --> 05:43.440
Okay, let's move the test over here and verify over here.

05:44.600 --> 05:45.160
And.

05:47.320 --> 05:53.520
We don't need to see the list because by default it will be false and seen by.

05:53.720 --> 05:57.080
Let me show you when we create a new message.

05:57.640 --> 05:59.360
The symbol will be.

06:00.160 --> 06:02.800
uh, current user also.

06:04.920 --> 06:05.400
Right.

06:05.960 --> 06:09.880
When we send a message, it means we send the message.

06:09.920 --> 06:10.360
Right?

06:11.120 --> 06:13.240
So that's about the message over here.

06:13.760 --> 06:15.280
And we will save that.

06:17.080 --> 06:19.680
And if you remember us.

06:22.520 --> 06:28.880
Inside conversation we have something called last message.

06:29.320 --> 06:32.600
So how we can manipulate us.

06:33.120 --> 06:35.360
Well it's very simple.

06:35.880 --> 06:41.720
When we send a new message, it means the new message over here is a last message.

06:41.760 --> 06:42.240
Right?

06:42.960 --> 06:51.080
So right here we need to update last message in conversation okay.

06:51.120 --> 06:52.280
How we can do that.

06:52.560 --> 07:00.010
Firstly we need to inject the conversation over here Roy.

07:04.170 --> 07:04.770
Robert.

07:06.930 --> 07:14.090
Survey with a survey and make sure we spot that.

07:16.770 --> 07:18.570
Go to the conversation module.

07:19.850 --> 07:22.250
Spark conversation survey.

07:26.930 --> 07:27.410
Okay.

07:28.770 --> 07:31.170
And inside the message module.

07:31.730 --> 07:34.970
Let's import the conversation.

07:39.490 --> 07:40.090
Module.

07:41.810 --> 07:42.330
Okay.

07:43.010 --> 07:44.610
And I run right here.

07:44.650 --> 07:45.890
Come from the controller.

07:45.930 --> 07:47.130
Don't worry about us.

07:48.250 --> 07:55.290
We already got the conversation service and update us in order to update us.

07:55.330 --> 07:59.330
We should write the logic inside the.

07:59.330 --> 07:59.380
No.

08:01.540 --> 08:04.900
Conversation of it will light.

08:08.980 --> 08:11.980
Up that last message.

08:12.220 --> 08:12.780
Okay.

08:13.300 --> 08:13.860
Right here.

08:13.860 --> 08:17.100
We only need a conversation ID right string.

08:18.340 --> 08:21.500
And we need to update that.

08:21.860 --> 08:24.340
I will I will call this not.

08:27.620 --> 08:34.540
Conversation model dot find by id and that.

08:41.580 --> 08:49.780
Would add it over here and last verses where is um.

08:53.060 --> 08:54.460
Last message over here.

08:55.180 --> 08:55.740
Okay.

08:56.900 --> 09:03.750
In here we will improve the last message.

09:03.790 --> 09:06.350
Oh, actually, we can need to view the ID.

09:06.750 --> 09:07.590
This should work.

09:09.030 --> 09:10.550
Let me call the message ID.

09:11.190 --> 09:11.670
Okay.

09:12.390 --> 09:14.150
What message are they over here?

09:15.470 --> 09:18.630
And new job.

09:20.990 --> 09:21.830
And I see.

09:33.070 --> 09:38.350
Here we need to write a chat with no conversation.

09:39.310 --> 09:41.270
Throw new error.

09:43.230 --> 09:43.630
Sorry.

09:44.390 --> 09:45.310
Not found error.

09:47.670 --> 09:48.430
Etc..

09:48.830 --> 09:49.310
Sorry.

09:49.990 --> 09:53.470
Uh, conversation.

09:53.830 --> 09:54.590
Not far.

09:55.470 --> 09:56.030
Okay.

09:56.470 --> 10:00.350
We don't need to return anything Services with.

10:00.390 --> 10:07.590
We need to provide this dot conversation dot that last message.

10:08.190 --> 10:14.990
We will converge session ID right here and message ID come from here.

10:18.630 --> 10:28.870
I will call the save message right say message not underscore.

10:31.030 --> 10:36.390
And right here you can convert it to script okay.

10:36.910 --> 10:40.710
So not about the same message.

10:41.230 --> 10:46.550
And in later for sure we need to do the real time over here.

10:47.350 --> 10:48.270
Don't worry about that.

10:50.310 --> 10:53.990
So let me go to the message controllers.

10:54.590 --> 10:58.070
And finally let me remove the create message video.

10:59.400 --> 11:00.320
And ten.

11:01.080 --> 11:01.760
Message.

11:03.240 --> 11:05.600
Send message right here.

11:20.240 --> 11:21.040
Conversation.

11:21.040 --> 11:24.760
And we need to change a little bit.

11:26.240 --> 11:30.840
So let's change the controller into the message.

11:31.200 --> 11:31.640
Okay.

11:32.840 --> 11:36.280
And boss, last conversation.

11:37.920 --> 11:40.040
The last conversation.

11:41.360 --> 11:44.800
Let's say conversation.

11:45.040 --> 11:46.560
Conversation okay.

11:47.720 --> 11:50.360
And finally we need to conversation.

11:50.360 --> 11:57.600
And let me use the param with the conversation I.

12:00.210 --> 12:01.850
And passed.

12:04.250 --> 12:04.730
Away.

12:06.170 --> 12:06.570
I.

12:09.810 --> 12:11.330
Had a rebellious streak.

12:12.570 --> 12:13.050
Okay.

12:16.930 --> 12:18.250
Said Mrs. Little.

12:19.570 --> 12:21.890
And one more thing will be the current user.

12:30.930 --> 12:31.410
Okay.

12:33.890 --> 12:34.970
Current user.

12:35.850 --> 12:38.650
We should use the God.

12:51.530 --> 12:52.690
We got the error.

12:53.290 --> 12:55.570
Come from the update message.

12:55.570 --> 12:59.730
Little bit will go here and remove this.

13:09.290 --> 13:16.010
Okay, now let's open the ibai tested.

13:21.970 --> 13:23.610
RM right here.

13:24.530 --> 13:26.530
Let me create a new folder.

13:29.650 --> 13:30.730
Have you got the folder?

13:30.730 --> 13:30.930
Right.

13:30.930 --> 13:33.970
Here is a message.

13:37.010 --> 13:39.130
And now I will run it.

13:40.130 --> 13:40.490
Mm.

13:44.330 --> 13:44.690
Mm.

13:54.730 --> 13:55.090
Mm.

14:02.660 --> 14:04.300
Hit very hard to the right.

14:05.500 --> 14:05.940
Let me.

14:05.940 --> 14:06.180
Ah!

14:06.220 --> 14:06.700
Did it.

14:10.300 --> 14:11.780
And in here.

14:14.180 --> 14:17.180
I will click new folder right here.

14:18.340 --> 14:18.940
Message.

14:22.660 --> 14:25.100
And outside okay.

14:34.340 --> 14:34.780
Okay.

14:34.780 --> 14:36.020
Maybe like that.

14:38.300 --> 14:42.620
Uh, or, uh, ATB request.

14:42.660 --> 14:45.660
Or we can try to.

14:48.020 --> 14:49.580
Duplicate this here.

14:54.620 --> 14:57.940
And inside the message and chain.

14:58.790 --> 15:00.790
let me close everything.

15:04.350 --> 15:05.070
Is right here.

15:15.710 --> 15:16.430
Sorry.

15:17.390 --> 15:18.110
My bad.

15:18.150 --> 15:19.190
My apologies.

15:19.230 --> 15:22.910
This is the first time I use this thing.

15:22.950 --> 15:23.430
Okay.

15:31.430 --> 15:31.830
No.

15:31.870 --> 15:35.750
Maybe I will add a new request.

15:44.950 --> 15:46.910
Or Italy hub over here.

15:48.710 --> 15:49.510
Let me delete.

15:51.150 --> 15:51.630
Okay.

15:51.630 --> 15:52.710
Let me change.

15:53.150 --> 15:53.590
Change.

15:53.590 --> 15:53.950
There.

15:57.470 --> 15:58.040
We do.

15:58.960 --> 16:00.440
Send message.

16:04.920 --> 16:05.680
And message.

16:05.680 --> 16:06.360
Over here.

16:08.760 --> 16:09.600
Inside the body.

16:10.840 --> 16:17.960
We bought a little bit, but like we told the message conversation.

16:18.520 --> 16:21.120
And I will copy the conversation and.

16:24.240 --> 16:24.680
I.

16:27.360 --> 16:28.400
Put that over here.

16:29.640 --> 16:30.160
Okay.

16:30.640 --> 16:35.480
And over here we need to mark the text will be Aria.

16:38.160 --> 16:40.360
And we need the media file.

16:40.520 --> 16:44.480
Let me remove the media file right now.

16:48.560 --> 16:52.360
So right here let me say.

16:55.280 --> 17:04.600
Um, but before that, we can sign up or sign in with this access token.

17:11.320 --> 17:12.280
And say.

17:14.320 --> 17:17.320
Uh, we don't have any.

17:20.080 --> 17:20.760
Right now.

17:20.800 --> 17:27.520
But right here, you can say it's already created with the status to award.

17:30.440 --> 17:33.480
Let me go to the database and refresh.

17:34.040 --> 17:35.480
Click on the message.

17:39.440 --> 17:39.920
Okay.

17:39.960 --> 17:45.000
Now you can see we already got the headers and media file.

17:45.120 --> 17:45.640
Okay.

17:46.560 --> 17:49.640
And the sender right here will be my ID.

17:50.520 --> 17:57.320
And the symbol here will be my ID also okay is deleted will be false.

17:57.320 --> 17:57.370
Phones.

17:58.170 --> 18:01.810
So let me, uh, send one more time.

18:12.290 --> 18:14.170
Uh, right now we need a media file.

18:15.090 --> 18:18.570
Okay, let me upload something.

18:21.890 --> 18:26.890
Or we can upload multiple into the body right here.

18:26.930 --> 18:28.770
Let's show the file.

18:33.650 --> 18:36.450
And I will show something.

18:38.730 --> 18:42.250
Which you follow here.

18:47.090 --> 18:47.490
Um.

19:01.500 --> 19:03.300
We should not allow ways.

19:05.940 --> 19:09.380
To show mutual fire at the same time.

19:12.780 --> 19:13.500
Let me say.

19:22.420 --> 19:22.740
Mm.

19:27.620 --> 19:27.980
Mm.

19:29.180 --> 19:30.220
What about right now?

19:39.820 --> 19:40.180
Sure.

19:40.580 --> 19:41.180
Okay.

19:42.060 --> 19:47.940
And my boy, let me say upload multiple files.

19:54.900 --> 19:55.220
Huh?

19:59.670 --> 20:04.350
That we are really here.

20:05.670 --> 20:06.270
Delete.

20:13.870 --> 20:14.910
And duplicate.

20:22.870 --> 20:26.470
What the URL is their bodies.

20:29.470 --> 20:31.470
Let me show five.

20:35.550 --> 20:36.070
Okay.

20:37.470 --> 20:38.190
This here.

20:38.830 --> 20:41.110
And let me put one more file to say it.

20:41.150 --> 20:41.790
One or not.

20:48.030 --> 20:49.070
So far.

20:52.270 --> 20:54.390
Here, let me say.

20:58.670 --> 20:59.190
Okay.

20:59.230 --> 20:59.790
Right here.

20:59.790 --> 21:04.870
We still have let me copy this array entire array over here.

21:05.310 --> 21:12.150
Copy that and choose the send message in here.

21:12.350 --> 21:17.470
Let me put media files over here.

21:22.070 --> 21:22.590
Okay.

21:24.710 --> 21:31.790
And let me say so by the way to a one and refresh.

21:41.070 --> 21:45.070
Right here we already got the media file okay.

21:46.230 --> 21:47.990
This here and this here.

21:50.190 --> 21:52.510
So this already work right.

21:53.150 --> 21:55.110
And that's for the video.

21:55.150 --> 21:56.750
I will see you in the next one.
