Unverified Commit 63dd9bef authored by Armando Lüscher's avatar Armando Lüscher

Merge branch 'develop' into update_travis_tests

parents 162b541b 9cb761e3
...@@ -7,6 +7,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -7,6 +7,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Added ### Added
### Changed ### Changed
- Updated Travis to use Trusty containers (for HHVM) and add PHP 7.2 to the tests. - Updated Travis to use Trusty containers (for HHVM) and add PHP 7.2 to the tests.
- Add debug log entry instead of throwing an exception for duplicate updates.
### Deprecated ### Deprecated
### Removed ### Removed
### Fixed ### Fixed
......
...@@ -23,6 +23,5 @@ W: http://noplanman.ch ...@@ -23,6 +23,5 @@ W: http://noplanman.ch
D: Maintainer and Collaborator D: Maintainer and Collaborator
N: Jack'lul (alias) N: Jack'lul (alias)
E: jacklul@jacklul.com E: jacklulcat@gmail.com
W: http://jacklul.com
D: Maintainer and Collaborator D: Maintainer and Collaborator
...@@ -492,10 +492,6 @@ class DB ...@@ -492,10 +492,6 @@ class DB
$update_id = $update->getUpdateId(); $update_id = $update->getUpdateId();
$update_type = $update->getUpdateType(); $update_type = $update->getUpdateType();
if (count(self::selectTelegramUpdate(1, $update_id)) === 1) {
throw new TelegramException('Duplicate update received!');
}
// @todo Make this simpler: if ($message = $update->getMessage()) ... // @todo Make this simpler: if ($message = $update->getMessage()) ...
if ($update_type === 'message') { if ($update_type === 'message') {
$message = $update->getMessage(); $message = $update->getMessage();
......
...@@ -457,6 +457,13 @@ class Telegram ...@@ -457,6 +457,13 @@ class Telegram
//This is necessary to "require" all the necessary command files! //This is necessary to "require" all the necessary command files!
$this->getCommandsList(); $this->getCommandsList();
//Make sure we don't try to process update that was already processed
$last_id = DB::selectTelegramUpdate(1, $this->update->getUpdateId());
if ($last_id && count($last_id) === 1) {
TelegramLog::debug('Duplicate update received, processing aborted!');
return Request::emptyResponse();
}
DB::insertRequest($this->update); DB::insertRequest($this->update);
return $this->executeCommand($command); return $this->executeCommand($command);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment