Flow/Thanks

Upcoming feature, under development by Facebook Open Academy students. Trello card

Issues

 * Figure out if we can re-use Extension:Thanks
 * Thanks stores states in session and cookies for last 100 thanks made
 * Thanks link for edits appears on a history page, but according to trello, Flow has it besides the post itself.
 * Thanks depends on revId, Flow stores its own id.
 * No-Javascript

Approaches

 * Make Thanks aware of Flow
 * Reimplement Flow in Thanks
 * Subclass Thanks in Flow

What Thanks does

 * Register a new type of notifications with Echo
 * Eventually calls ApiThank::sendThanks, which creates an Echo event
 * Handles Echo's hooks to format and display notifications

Other (deferred)

 * remembering Thanked state (Thanks does it in PHP session and cookie)

Information needed for Flow Thanks API

 * PostRevision object
 * Workflow object
 * User object for the user sending Thanks ApiBase (through ContextSource) gives this to us for free
 * Edit token (mw.user.tokens.values.editToken)

Sample API request from Thanks: ( new mw.Api ).get( {	'action' : 'thank',	'rev' : $thankLink.attr( 'data-revision-id' ),	'source' : source,	'token' : mw.user.tokens.values.editToken } )