[patch] Chat translation rules

Notes on testing the latest builds of MapTool

Moderators: dorpond, trevor, Azhrei

Post Reply
tiorthan
Cave Troll
Posts: 84
Joined: Fri Aug 24, 2012 8:56 am
Location: Germany
Contact:

[patch] Chat translation rules

Post by tiorthan »

This is a patch for the second issue in http://forums.rptools.net/viewtopic.php ... 69&start=0

The attached patch introduces a new private class SmileyChatTranslationRuleGroup.SmileyTranslationRule which tries to parse chat messages as HTML and replaces smileys only in text elements.

Edit: New patch file
Attachments
maptool.smileyreplaceinhtml.patch.txt
(4.82 KiB) Downloaded 317 times

tiorthan
Cave Troll
Posts: 84
Joined: Fri Aug 24, 2012 8:56 am
Location: Germany
Contact:

Re: [patch] Chat translation rules

Post by tiorthan »

I've rewritten the patch in a way that should properly mask roll output from any chat translation functions.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [patch] Chat translation rules

Post by Azhrei »

Patch reverted circa SVN rev 5930.

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: [patch] Chat translation rules

Post by Lee »

I think I was able to fix the issue with this patch. It had a slightly overzealous regex pattern and modifying it a bit got rid of the reported behaviors. Patch uploaded.
Attachments
maptool.smileyreplaceinhtml.patch (fixed).txt
(10.17 KiB) Downloaded 124 times

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [patch] Chat translation rules

Post by Azhrei »

I actually changed the regex used in the XML that was identifying what was a smiley and what wasn't. Instead of using somthing like (:\)|:D) as the regex it now uses \b(:\)|:D)\b. Adding the word boundaries seemed to work in my testing, but I haven't committed this yet as I wanted to look at some of the problem cases and review them first.

But if it turns out to not be enough, then I'll apply this patch and take a look at it.

Thanks!

Post Reply

Return to “Testing”