As title says, we need to start developing Huggle to be able to warn a user, even if s/he has Flow activated, since it will soon be opt-in.
Huggle is translated at Cawp, Frwp, Hewp, Svwp, [ 1 ] (which are amongst the list of communities interested in the Flow opt-in).
WIP:
Design: since flow is extension to mediawiki and not part of core, this will be implemented in huggle as well as extension. The main code will be here: https://github.com/huggle/extension-flow
The branch I made in huggle core contains code changes to core necessary to override internal messaging subsystem as well as link to flow extension.
The main idea how to implement this is to create an override of class Huggle::Message (I call it MessageFlow) that will reimplement almost everything related to message handling using Flow API. When we want to send a message in huggle, it's done using WikiUtil::SendMessage which now has a hook to a virtual function that can be implemented by an extension, and it can basically override whole function if it needs.
TO-DO:
- verify that we don't really send messages anywhere any other way than through SendMessage: we don't
- check if target user support flow
- read how flow API works and figure out how to send / read messages: https://test.wikipedia.org/w/api.php?action=help&modules=flow
Diagram:
+---------------------------------+ |New message delivery is requested| +------------+--------------------+ | | | Extension hook | | v Nope +------------+-------------+ Yes +-------------+Is flow supported on wiki?+---------+ | +--------------------------+ | | | | | | +-------+-------------------+ | |Override with MessageFlow | | |delivery class and initiate| v |asynchronous query to check| +--------+------------+ |if target user has flow | |Standard delivery +--------------+ +-------+-------------------+ +---------------------+ | <- Nope | +----------------------+------------------+ +----------------------+ |Query finished, does user| |Deliver using flow API+-----------------------------+has flow on talk? | +----------------------+ <- Yes +-------------------------+