About: Hooking outgoing chat messages   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : dbkwik.org associated with source dataset(s)

To modify outgoing chat messages we are going to hook the ChatEdit_ParseText function. However, this function also handles macros; so to avoid tainting we must use hooksecurefunc() to hook the function properly. Otherwise, your macros will no longer work. -- Place this code in the OnLoad function of your addon hooksecurefunc('ChatEdit_ParseText',MyAddon_ParseText); MyAddon_ParseText will now be called after ChatEdit_ParseText has had a chance to handle macros and slash commands.

AttributesValues
rdfs:label
  • Hooking outgoing chat messages
rdfs:comment
  • To modify outgoing chat messages we are going to hook the ChatEdit_ParseText function. However, this function also handles macros; so to avoid tainting we must use hooksecurefunc() to hook the function properly. Otherwise, your macros will no longer work. -- Place this code in the OnLoad function of your addon hooksecurefunc('ChatEdit_ParseText',MyAddon_ParseText); MyAddon_ParseText will now be called after ChatEdit_ParseText has had a chance to handle macros and slash commands.
dcterms:subject
abstract
  • To modify outgoing chat messages we are going to hook the ChatEdit_ParseText function. However, this function also handles macros; so to avoid tainting we must use hooksecurefunc() to hook the function properly. Otherwise, your macros will no longer work. -- Place this code in the OnLoad function of your addon hooksecurefunc('ChatEdit_ParseText',MyAddon_ParseText); MyAddon_ParseText will now be called after ChatEdit_ParseText has had a chance to handle macros and slash commands. function MyAddon_ParseText(chatEntry, send) -- This function actually gets called every time the user hits a key. But the -- send flag will only be set when he hits return to send the message. if (send == 1) then local text = chatEntry:GetText(); -- Here's how you get the original text local newText = text; -- here's where you can modify the text to your liking chatEntry:SetText( newText ); -- send the new text back to the UI end end
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software