Skip to content

Commit 7147479

Browse files
committed
Merge pull request #101 from akalongman/excody_fix
Excody fix
2 parents aae0d91 + 8010d2a commit 7147479

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/DB.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -509,22 +509,17 @@ public static function insertMessageRequest(Message &$message)
509509
self::insertUser($forward_from, $forward_date);
510510
$forward_from = $forward_from->getId();
511511
}
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
516515
self::insertUser($new_chat_participant, $date, $chat);
517516
$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
523519
self::insertUser($left_chat_participant, $date, $chat);
524520
$left_chat_participant = $left_chat_participant->getId();
525521
}
526522

527-
528523
try {
529524
//message Table
530525
$sth = self::$pdo->prepare('INSERT IGNORE INTO `' . TB_MESSAGE . '`
@@ -604,8 +599,8 @@ public static function insertMessageRequest(Message &$message)
604599
$sth->bindParam(':caption', $caption, \PDO::PARAM_STR);
605600
$sth->bindParam(':contact', $contact, \PDO::PARAM_STR);
606601
$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);
609604
$sth->bindParam(':new_chat_title', $new_chat_title, \PDO::PARAM_STR);
610605

611606
//Array of Photosize

0 commit comments

Comments
 (0)