File tree Expand file tree Collapse file tree 3 files changed +38
-28
lines changed Expand file tree Collapse file tree 3 files changed +38
-28
lines changed Original file line number Diff line number Diff line change @@ -88,4 +88,4 @@ Sign-in your first user and login
88
88
#### Maintainers
89
89
90
90
- [ Ganesh Kandu] ( https://github.com/GaneshKandu )
91
- - [Linkedin](https://www.linkedin.com/in/ganesh-kandu-42b14373 /)
91
+ - [Linkedin](https://www.linkedin.com/in/ganeshkandu /)
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ function kchat(Request $request){
74
74
$ data ['messages ' ] = array_reverse ($ data ['messages ' ]);
75
75
}
76
76
77
+ foreach ($ data ['messages ' ] as $ i => $ v ){
78
+ $ data ['messages ' ][$ i ]->first_name = htmlentities ($ data ['messages ' ][$ i ]->first_name );
79
+ $ data ['messages ' ][$ i ]->last_name = htmlentities ($ data ['messages ' ][$ i ]->last_name );
80
+ $ data ['messages ' ][$ i ]->message = htmlentities ($ data ['messages ' ][$ i ]->message );
81
+ }
82
+
77
83
if (count ($ data ['messages ' ])){
78
84
79
85
if (end ($ data ['messages ' ])->id > session ()->get ('message_id ' )){
@@ -106,13 +112,22 @@ function kchat(Request $request){
106
112
}
107
113
108
114
$ data ['chats ' ] = $ tmp ->get ()->toArray ();
115
+
116
+ foreach ($ data ['chats ' ] as $ i => $ v ){
117
+ $ data ['chats ' ][$ i ]->conversation_name = htmlentities ($ data ['chats ' ][$ i ]->conversation_name );
118
+ $ data ['chats ' ][$ i ]->first_name = htmlentities ($ data ['chats ' ][$ i ]->first_name );
119
+ $ data ['chats ' ][$ i ]->last_name = htmlentities ($ data ['chats ' ][$ i ]->last_name );
120
+ $ data ['chats ' ][$ i ]->message = htmlentities ($ data ['chats ' ][$ i ]->message );
121
+ }
109
122
110
123
if (count ($ data ['chats ' ])){
111
124
if (end ($ data ['chats ' ])->mid > session ()->get ('chat_id ' )){
112
125
session ()->put ('chat_id ' , end ($ data ['chats ' ])->mid );
113
126
}
114
127
}
115
-
128
+
129
+ //print_r($data);
130
+
116
131
return json_encode ($ data );
117
132
}
118
133
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ $(document).ready (function(){
190
190
LoadMessage = true ;
191
191
} ,
192
192
error : function ( result ) {
193
-
193
+ LoadMessage = true ;
194
194
}
195
195
} ) ;
196
196
}
@@ -242,38 +242,33 @@ $(document).ready (function(){
242
242
243
243
} ) ;
244
244
245
- search_convo = true ;
246
-
247
245
$ ( "#convo_like" ) . keyup ( function ( ) {
248
246
249
247
Search = { } ;
250
248
251
249
Search [ '_token' ] = $ ( 'meta[name="csrf_token"]' ) . attr ( 'content' ) ;
252
250
Search [ 'convo_like' ] = $ ( this ) . val ( ) ;
253
251
254
- if ( search_convo ) {
255
- search_convo = false ;
256
- $ . ajax ( {
257
- type : "POST" ,
258
- url : '/getConvo' ,
259
- data : Search ,
260
- success : function ( results ) {
261
- search_convo = true ;
262
- results = $ . parseJSON ( results ) ;
263
- html = '' ;
264
- results . forEach ( function ( element ) {
265
- html += `<tr>
266
- <td><a href="/messages/?chat=${ element . id } " ><img src="${ element . photo } " class="rounded-circle my-n1" alt="[Photo]" width="32" height="32"></a></td>
267
- <td><a href="/messages/?chat=${ element . id } " >${ element . conversation_name } </a></td>
268
- </tr>`
269
- } ) ;
270
- $ ( '#ConvoList' ) . html ( html ) ;
271
- } ,
272
- error : function ( result ) {
273
-
274
- }
275
- } ) ;
276
- }
252
+ $ . ajax ( {
253
+ type : "POST" ,
254
+ url : '/getConvo' ,
255
+ data : Search ,
256
+ success : function ( results ) {
257
+ search_convo = true ;
258
+ results = $ . parseJSON ( results ) ;
259
+ html = '' ;
260
+ results . forEach ( function ( element ) {
261
+ html += `<tr>
262
+ <td><a href="/messages/?chat=${ element . id } " ><img src="${ element . photo } " class="rounded-circle my-n1" alt="[Photo]" width="32" height="32"></a></td>
263
+ <td><a href="/messages/?chat=${ element . id } " >${ element . conversation_name } </a></td>
264
+ </tr>`
265
+ } ) ;
266
+ $ ( '#ConvoList' ) . html ( html ) ;
267
+ } ,
268
+ error : function ( result ) {
269
+
270
+ }
271
+ } ) ;
277
272
278
273
} ) ;
279
274
You can’t perform that action at this time.
0 commit comments