Hi everyone!

I'm trying to write my notification for Echo and I'm a bit stuck coding the
formatter. The standard way to write a formatter seems to override the
processParam function (like in Thanks extension). There is a lot of magic
in the code below, I can't figure out how the processParam function must be
handled. My questions are in the comments and if someone can explain a
little bit of what's possible to do inside processParam, I'd be very
grateful.

class EchoThanksFormatter extends EchoBasicFormatter {

   protected function processParam( $event, $param, $message, $user ) {
      if ( $param === 'difflink' ) {
         $eventData = $event->getExtra();
         if ( !isset( $eventData['revid'] ) ) {
            $message->params( '' );
            return;
         }
         $this->setTitleLink(
            $event,
            $message,
            array(
               'class' => 'mw-echo-diff',
               'linkText' => wfMessage(
'notification-thanks-diff-link' )->text(),
               'param' => array( // what is the possible structure of
this param array?
                  'oldid' => $eventData['revid'],
                  'diff' => 'prev', //what is that? Are  diff and prev
some kind of reserved words? Where can I find the whole list of these
words?
               )
            )
         );

      } else {
         parent::processParam( $event, $param, $message, $user );
      }
   }
}

Cheers,

-----
Yury Katkov
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to