jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Remove direct echo db access from mobilefrontend"
......................................................................
Revert "Remove direct echo db access from mobilefrontend"
Revert this for now due to Echo not being stable, I don't want to break
MobileFrontend, :), Re-apply this code back when the new Echo code is in
both deployment branches
This reverts commit 71cd7eddc735f4a7fbe0a58e11577f2302a3e22a.
Change-Id: I5004d3a56cb08d561bab0c9a3e538e18596818e8
---
M includes/MobileUserInfo.php
1 file changed, 16 insertions(+), 11 deletions(-)
Approvals:
MaxSem: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/MobileUserInfo.php b/includes/MobileUserInfo.php
index 5d9bd5e..520c7ad 100644
--- a/includes/MobileUserInfo.php
+++ b/includes/MobileUserInfo.php
@@ -168,18 +168,23 @@
$thank = false;
// Check that the Thank Extension and Echo extension are both
installed
// before doing this (bug 56825).
- if ( class_exists( 'EchoNotificationMapper' ) && class_exists(
'ApiThank' ) ) {
- // @FIXME - Inject the instance into the class for
unittest?
- $mapper = new EchoNotificationMapper();
- $notifs = $mapper->fetchByUser(
- $this->user, 1, null, array( 'edit-thank' )
+ if ( class_exists( 'MWEchoDbFactory' ) && class_exists(
'ApiThank' ) ) {
+ $dbr = MWEchoDbFactory::getDB( DB_SLAVE );
+ $rows = $dbr->select(
+ array( 'echo_event', 'echo_notification' ),
+ 'event_agent_id, notification_timestamp',
+ array(
+ 'notification_user' =>
$this->user->getId(),
+ 'event_id=notification_event',
+ 'event_type' => 'edit-thank' ),
+ __METHOD__,
+ array( 'ORDER BY' => 'notification_timestamp
DESC' )
);
- if ( $notifs ) {
- $notif = reset( $notifs );
- $agent = $notif->getEvent()->getAgent();
- if ( $agent ) {
- $thank = array( 'user' => $agent );
- }
+ $row = $rows->fetchObject();
+ if ( $row ) {
+ $thank = array(
+ 'user' => User::newFromId(
$row->event_agent_id ),
+ );
}
}
wfProfileOut( __METHOD__ );
--
To view, visit https://gerrit.wikimedia.org/r/156696
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5004d3a56cb08d561bab0c9a3e538e18596818e8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits