1. Unregistered users can now participate on SneakyDave.com. All posts are moderated, which means they won't show up until they're approved.
    Dismiss Notice

Chat Markenator - How To Fix The Edit Bug

Discussion in 'XFStuff' started by SneakyDave, Aug 19, 2016.

  1. SneakyDave

    SneakyDave Solid Mean
    Staff Member

    Joined:
    Dec 8, 2011
    Messages:
    2,860
    Likes Received:
    838
    I've been asked how to fix the edit bug for this addon, so I'm providing it here, and will post it on XenForo.

    The Edit Bug is described as a condition in where a chat message is edited by a user, and then usergroups that are not supposed to see those chats can view them unmasked for a temporary period of time until their screen refreshes. This bug is caused by the fact that Siropu Chat has a temporary file it stores HTML markup to display via Ajax. This file is processed via static methods in the add-on, and static methods cannot be extended in Xenforo's system.

    This fix requires an file edit to Siropu Chat, the HelperActions class.

    NOTE 1: This bug only appears temporarily between the time a chat is edited, and a person without permission to view the chat unmask refreshes his screen.

    NOTE 2: This fix is a file edit on Siropu Chat's file in your xfroot/library/Siropu/Chat/HelperActions.php file. Every time you upgrade Siropu Chat, you'll have to re-apply this edit.

    NOTE 3: Make a backup of your xfroot/library/Siropu/Chat/HelperActions.php file first.

    Edit the xfroot/library/Siropu/Chat/HelperActions.php, look for this named method:
    Code:
    getMessageActions()
    Then in that method, find this code: There should be one instance of it.
    Code:
    foreach ($actions as $key => $val)
    {
    
    Finally, insert this code immediately after the above foreach:
    Code:
             //Start Hack for Chat Markenator to work with temporary file.
             if($val['message']) {
                 if(XenForo_Permission::hasPermission(XenForo_Visitor::getInstance()->getPermissions(),
                     'siropu_chat', "chat_markenator")) {
                     $data[$roomId][$key]['message'] = "[edited]";
                 }
             }
             //End Hack for Chat Markenator to work with temporary file.
    
     
    #1 SneakyDave, Aug 19, 2016
    Last edited: Oct 18, 2016
  2. SneakyDave

    SneakyDave Solid Mean
    Staff Member

    Joined:
    Dec 8, 2011
    Messages:
    2,860
    Likes Received:
    838
    The instructions to fix the "edit bug" have been updated for Siropu Chat 1.24.4 and above.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice