Merge pull request #209 from wizardfrag/actions
Fix issue #208 and an issue where the word ACTION in a /me can be stripped
This commit is contained in:
commit
61eb300393
|
@ -5,7 +5,7 @@ var Msg = require("../../models/msg");
|
|||
module.exports = function(irc, network) {
|
||||
var client = this;
|
||||
irc.on("message", function(data) {
|
||||
if (data.message.indexOf("\001") === 0) {
|
||||
if (data.message.indexOf("\u0001") === 0 && data.message.substring(0, 7) != "\u0001ACTION") {
|
||||
// Hide ctcp messages.
|
||||
return;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ module.exports = function(irc, network) {
|
|||
var text = data.message;
|
||||
if (text.split(" ")[0] === "\u0001ACTION") {
|
||||
type = Msg.Type.ACTION;
|
||||
text = text.replace(/\u0001|ACTION/g, "");
|
||||
text = text.replace(/^\u0001ACTION|\u0001$/g, "");
|
||||
}
|
||||
|
||||
text.split(" ").forEach(function(w) {
|
||||
|
|
Loading…
Reference in New Issue