Jump to content

User:Legoktm/pings

From mediawiki.org

task T128535

Pings suck because:

  • Based on username linking, which is used for other things... like linking to users (c.f. {{noping}} on enwp)
  • No way to verify you actually pinged someone
  • Requires a signature
  • Can't go back and adjust text to ping someone
    • Three preceding bullets are about same general issue, namely that you can't reliably trust pings to work
    • Technically possible to "go back" by re-signing the edit, probably?

Idea!:

  • Create a PST magic word thing so you type in "{{#ping:User}}", which upon save is transformed into "[[User:User|User]]" (and support multiple users with $wgContLang->commaList()).
    • Pinging has historically been a bit weird with template expansion; we used to have "phantom" pings caused by someone transcluding a page, mass-pinging, and then having that transclusion reverted
  • Echo hooks into PST somehow to do the transformation and note which users were mentioned
  • Easy for users to verify their pings went through
    • How?
      • Because if it went through, the wikitext would be transformed into [[User:User|User]]
    • Maybe use Special:Log to log pings?
      • Might help prevent abuse
  • Pinging has to be deliberate, but most people are already using the wrapper template so it shouldn't be too disruptive
  • Need to account for pinging abuse/mis-use
    • Current pinging has hard limit for users that can be pinged
      • Right, how do you handle the maximum ping limit? Does the parser function just not get transformed in this case?
        • We can also display a warning and stop the edit.

Notes:

  • Is this even technically possible???
    • Discussed in #mediawiki-parsoid on 2016-08-15 with Lego, Tim and MZ. Mostly these are Tim's recommendations:
      • Add a flag like Parser::SFH_SUBST_IMPLIED to Parser::setFunctionHook(), check it in Parser::braceSubstitution() before the check for mSubstWords
      • Note: Check for PST mode using $parser->ot['wiki']
      • Add new method to Content which returns the full ParserOutput as well as the new Content object; use Parser::getOutput() after preSaveTransform() returns and then prepareContentForEdit() would put the PST ParserOutput object into mPreparedEdit in a new member
  • On-wiki templates might be implemented differently, so overriding them with magic word might cause problems.
    • Syntax is different ({{#ping:foo}} instead of {{ping|bar}}), should be fine
  • What about saving pages that already have a old "ping" template on them? Will it trigger new notifications?
    • Matt pointed out that the syntax would be {{#ping:User}} so it wouldn't conflict.