Skip to content

Commit 016b2c1

Browse files
committed
Don't update chat info to db if request from TG failed
1 parent b1f9b6a commit 016b2c1

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

mods/overview_refresh.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@
5656

5757
if($overview_row['update_needed'] == 1) {
5858
[$chat_title, $chat_username] = get_chat_title_username($overview_row['chat_id']);
59-
my_query('
60-
UPDATE overview
61-
SET chat_title = ?,
62-
chat_username = ?,
63-
updated = DATE(NOW())
64-
WHERE chat_id = ?
65-
',[$chat_title, $chat_username, $overview_row['chat_id']]
66-
);
59+
if($chat_title == '' && $chat_username == '') {
60+
my_query('
61+
UPDATE overview
62+
SET chat_title = ?,
63+
chat_username = ?,
64+
updated = DATE(NOW())
65+
WHERE chat_id = ?
66+
',[$chat_title, $chat_username, $overview_row['chat_id']]
67+
);
68+
}
6769
}else {
6870
$chat_title = $overview_row['chat_title'];
6971
$chat_username = $overview_row['chat_username'];

0 commit comments

Comments
 (0)