@@ -509,22 +509,17 @@ public static function insertMessageRequest(Message &$message)
509
509
self ::insertUser ($ forward_from , $ forward_date );
510
510
$ forward_from = $ forward_from ->getId ();
511
511
}
512
-
513
- //Insert the new chat user
514
- $ new_chat_participant = '' ;
515
- if (is_object ($ new_chat_participant )) {
512
+
513
+ if ($ new_chat_participant ) {
514
+ //Insert the new chat user
516
515
self ::insertUser ($ new_chat_participant , $ date , $ chat );
517
516
$ new_chat_participant = $ new_chat_participant ->getId ();
518
- }
519
-
520
- //Insert the left chat user
521
- $ left_chat_participant = '' ;
522
- if (is_object ($ left_chat_participant )) {
517
+ } elseif ($ left_chat_participant ) {
518
+ //Insert the left chat user
523
519
self ::insertUser ($ left_chat_participant , $ date , $ chat );
524
520
$ left_chat_participant = $ left_chat_participant ->getId ();
525
521
}
526
522
527
-
528
523
try {
529
524
//message Table
530
525
$ sth = self ::$ pdo ->prepare ('INSERT IGNORE INTO ` ' . TB_MESSAGE . '`
@@ -604,8 +599,8 @@ public static function insertMessageRequest(Message &$message)
604
599
$ sth ->bindParam (':caption ' , $ caption , \PDO ::PARAM_STR );
605
600
$ sth ->bindParam (':contact ' , $ contact , \PDO ::PARAM_STR );
606
601
$ sth ->bindParam (':location ' , $ location , \PDO ::PARAM_STR );
607
- $ sth ->bindParam (':new_chat_participant ' , $ new_chat_paticipant , \PDO ::PARAM_INT );
608
- $ sth ->bindParam (':left_chat_participant ' , $ left_chat_paticipant , \PDO ::PARAM_INT );
602
+ $ sth ->bindParam (':new_chat_participant ' , $ new_chat_participant , \PDO ::PARAM_INT );
603
+ $ sth ->bindParam (':left_chat_participant ' , $ left_chat_participant , \PDO ::PARAM_INT );
609
604
$ sth ->bindParam (':new_chat_title ' , $ new_chat_title , \PDO ::PARAM_STR );
610
605
611
606
//Array of Photosize
0 commit comments