This is one of those starter tickets. I know MEMark is working on it, I was just looking at it as a starting point to understand a bit more about the codebase (since there are no other starter issues).
So the CBActionSupportPlugin is listed as a template; I get the code there, and it's registered in the CoreComponents.plist file..so far so good.
Is there a way to have a plug-in such as this only apply to one particular chat mechanism? Maybe it doesn't matter...would anyone care if _bold_ ended up formatted on all chat protocols?
CBActionSupportPlugin (ticket 1837)
I'm done coding for some time now. Just waiting for Evan to reply to my email for some details.
As for your question, I believe a message filter applies ruthlessly to all messages. But try investigating the 'context' parameter sent to filterAttributedString. Perhaps it says something about what account is receiving the message and what service it is on?
robfromca, feel free to finish your implementation. Then we could compare them and choose the best one to submit!
Edit: Another thing regarding this... this formatting '*bold*' => 'bold' collides with the action support '/me codes' => '*codes*'. Any ideas on how to avoid this? Just disable the formatting when it surrounds the entire message? Or is there a way to specify in what order filters are applied?
As for your question, I believe a message filter applies ruthlessly to all messages. But try investigating the 'context' parameter sent to filterAttributedString. Perhaps it says something about what account is receiving the message and what service it is on?
robfromca, feel free to finish your implementation. Then we could compare them and choose the best one to submit!
Edit: Another thing regarding this... this formatting '*bold*' => 'bold' collides with the action support '/me codes' => '*codes*'. Any ideas on how to avoid this? Just disable the formatting when it surrounds the entire message? Or is there a way to specify in what order filters are applied?
Regards
Magnus Erik Markling
Magnus Erik Markling
- Catfish_Man
- Cocoaforge Admin
- Posts: 1203
- Joined: Thu Dec 02, 2004 6:30 am
- Location: Portland, Oregon
- Contact:
Check out the filter priority stuff. I don't remember how it's set, but you can specify what order things run in to a certain extent.memark wrote:I'm done coding for some time now. Just waiting for Evan to reply to my email for some details.![]()
As for your question, I believe a message filter applies ruthlessly to all messages. But try investigating the 'context' parameter sent to filterAttributedString. Perhaps it says something about what account is receiving the message and what service it is on?
robfromca, feel free to finish your implementation. Then we could compare them and choose the best one to submit!
Edit: Another thing regarding this... this formatting '*bold*' => 'bold' collides with the action support '/me codes' => '*codes*'. Any ideas on how to avoid this? Just disable the formatting when it surrounds the entire message? Or is there a way to specify in what order filters are applied?
I would be fine with having the formatting apply to all protocols.
<edit>
I also really need to add some more good starter tickets. If anyone has suggestions, please let me know.
</edit>
Thanks to you and evands for the hint about filter priority. As you say, it works to some extent...
The action support (AS) plugin is of type AIFilterContent ("Changes actual message and non-message content").
My Google talk (GT)formatting plugin is of type AIFilterMessageDisplay ("Changes only how messages are displayed locally").
This presents a problem, since AIFilterContent filters are always applied ahead of AIFilterMessageDisplay filters, regardless of their respective priorities. (Which of course makes sense.)
Changing GT to AIFilterContent is not an option, since messages received by others would then be displayed in all bold, not just the actual word, due to limitations in the protocol/all clients I've tried.
Changing AS to AIFilterMessageDisplay is an option, but then recipients would still see "/me is coding" unless their client converts it.
Another option would be to try to figure out if we're dealing with a converted action message. Perhaps we could assume that all phrases that start and end with * used to be on the "/me form".
Any ideas?
The action support (AS) plugin is of type AIFilterContent ("Changes actual message and non-message content").
My Google talk (GT)formatting plugin is of type AIFilterMessageDisplay ("Changes only how messages are displayed locally").
This presents a problem, since AIFilterContent filters are always applied ahead of AIFilterMessageDisplay filters, regardless of their respective priorities. (Which of course makes sense.)
Changing GT to AIFilterContent is not an option, since messages received by others would then be displayed in all bold, not just the actual word, due to limitations in the protocol/all clients I've tried.
Changing AS to AIFilterMessageDisplay is an option, but then recipients would still see "/me is coding" unless their client converts it.
Another option would be to try to figure out if we're dealing with a converted action message. Perhaps we could assume that all phrases that start and end with * used to be on the "/me form".
Any ideas?
Regards
Magnus Erik Markling
Magnus Erik Markling