mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Fix push subscription retrieval
Updates the push subscription query to retrieve a provider string rather than only its numeric internal ID. Change-Id: I910173409e48e8b6a6739d3122165c40b0d52b7f
This commit is contained in:
parent
a145bd0cbe
commit
a5bcc65504
|
@ -22,7 +22,7 @@ class Subscription {
|
|||
*/
|
||||
public static function newFromRow( object $row ) {
|
||||
return new self(
|
||||
$row->eps_provider,
|
||||
$row->epp_name,
|
||||
$row->eps_token,
|
||||
new ConvertibleTimestamp( $row->eps_updated )
|
||||
);
|
||||
|
|
|
@ -70,10 +70,12 @@ class SubscriptionManager extends EchoAbstractMapper {
|
|||
*/
|
||||
public function getSubscriptionsForUser( int $centralId ) {
|
||||
$res = $this->dbr->select(
|
||||
'echo_push_subscription',
|
||||
[ 'echo_push_subscription', 'echo_push_provider' ],
|
||||
'*',
|
||||
[ 'eps_user' => $centralId ],
|
||||
__METHOD__
|
||||
__METHOD__,
|
||||
[],
|
||||
[ 'echo_push_provider' => [ 'INNER JOIN', [ 'eps_provider = epp_id' ] ] ]
|
||||
);
|
||||
$result = [];
|
||||
foreach ( $res as $row ) {
|
||||
|
|
|
@ -9,7 +9,7 @@ class SubscriptionTest extends MediaWikiUnitTestCase {
|
|||
public function testNewFromRow(): void {
|
||||
$row = new stdClass();
|
||||
$row->eps_token = 'ABC123';
|
||||
$row->eps_provider = 'fcm';
|
||||
$row->epp_name = 'fcm';
|
||||
$row->eps_updated = '2020-01-01 10:10:10';
|
||||
|
||||
$subscription = Subscription::newFromRow( $row );
|
||||
|
|
Loading…
Reference in a new issue