• Brion Vibber's avatar
    Consolidate some precondition checks for repeats, fix a couple bits in the repeat command. · 9adbb49f
    Brion Vibber authored
    Notice::saveNew() now does these checks directly when making a repeat:
    * make sure the original is valid and existing
    * stop you from repeating your own message
    * stop you from repeating something you've previously repeated
    * prevent repeats of any non-public messages
    * explicit inScope() check to make sure you can read the original too (just in case there's a funky extension at play that changes scoping rules)
    
    These error conditions throw exceptions, which the caller either uses as an error message or passes on up the stack, without having to duplicate the checks in each i/o channel.
    9adbb49f
apistatusesretweet.php 3.21 KB