Unverified Commit 7529fc4f authored by Armando Lüscher's avatar Armando Lüscher Committed by GitHub

Merge branch 'develop' into 955-bot_api_4.3

parents 0904162a 89af4d43
......@@ -8,9 +8,11 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Bot API 4.3 (Seamless Telegram Login, `LoginUrl`)
- `reply_markup` field to `Message` entity.
### Changed
- Use PSR-12 for code style.
### Deprecated
### Removed
### Fixed
- `forward_date` is now correctly saved to the DB.
### Security
## [0.57.0] - 2019-06-01
......
......@@ -47,7 +47,7 @@
},
"scripts": {
"check-code": [
"\"vendor/bin/phpcs\" --standard=phpcs.xml -snp --encoding=utf-8 src/ tests/ --report-width=150"
"\"vendor/bin/phpcs\" --standard=phpcs.xml -snp src/ tests/"
],
"test": [
"\"vendor/bin/phpunit\""
......
......@@ -3,8 +3,11 @@
<description>PHP Code Sniffer</description>
<arg name="colors"/>
<arg name="parallel" value="8"/>
<arg name="encoding" value="utf-8"/>
<arg name="report-width" value="150"/>
<rule ref="PSR2"/>
<rule ref="PSR12"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
......
......@@ -881,18 +881,17 @@ class DB
}
// Insert the forwarded message user in users table
$forward_date = null;
$forward_date = $message->getForwardDate() ? self::getTimestamp($message->getForwardDate()) : null;
$forward_from = $message->getForwardFrom();
if ($forward_from instanceof User) {
self::insertUser($forward_from, $forward_date);
self::insertUser($forward_from);
$forward_from = $forward_from->getId();
$forward_date = self::getTimestamp($message->getForwardDate());
}
$forward_from_chat = $message->getForwardFromChat();
if ($forward_from_chat instanceof Chat) {
self::insertChat($forward_from_chat, $forward_date);
self::insertChat($forward_from_chat);
$forward_from_chat = $forward_from_chat->getId();
$forward_date = self::getTimestamp($message->getForwardDate());
}
// New and left chat member
......
......@@ -74,7 +74,7 @@ class CommandTest extends TestCase
[null],
[12345],
['something'],
[new \stdClass],
[new \stdClass()],
[$this->telegram], // only this one is valid
];
......
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