From fbf0b2cb20848ab06ff49e042ba6f705e6b5e68f Mon Sep 17 00:00:00 2001 From: Kaldari Date: Wed, 20 Mar 2013 13:55:21 -0700 Subject: [PATCH] Add source for event logging Change-Id: Iee94b699ca5c8d927871871bf9a1b8afd1130d42 --- Notifier.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Notifier.php b/Notifier.php index 3e2245b38..e05de9a70 100644 --- a/Notifier.php +++ b/Notifier.php @@ -30,7 +30,6 @@ class EchoNotifier { } else { $group = 'neutral'; } - $data = array ( 'version' => $wgEchoConfig['version'], 'eventId' => $event->getId(), @@ -40,6 +39,11 @@ class EchoNotifier { 'recipientUserId' => $user->getId(), 'recipientEditCount' => (int)$user->getEditCount() ); + // Add the source if it exists. (This is mostly for the Thanks extension.) + $extra = $event->getExtra(); + if ( isset( $extra['source'] ) ) { + $data['eventSource'] = (string)$extra['source']; + } EchoHooks::logEvent( 'Echo', $data ); }