Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rest of the commit, b/c I gitfail

  • Loading branch information...
commit dd2953b1fcdde732c73fb3f02248aadf92ab0641 1 parent a0eb025
@DMXRoid DMXRoid authored
View
10 data/public/js/pfcclient.js
@@ -511,6 +511,9 @@ pfcClient.prototype = {
else if (cmd == "send")
{
}
+ else if (cmd == "nocensor") {
+
+ }
else
alert(cmd + "-"+resp+"-"+param);
},
@@ -2134,6 +2137,13 @@ pfcClient.prototype = {
},
/**
+ * Enable/disable censorship
+ */
+
+ toggleCensor: function () {
+ this.sendRequest('/nocensor');
+ },
+ /**
* Resize chat
*/
refresh_Chat: function()
View
1  src/phpfreechat.class.php
@@ -254,6 +254,7 @@ function &handleRequest($request)
if ($cmdname != "update" &&
$cmdname != "leave" && // do not open the pv tab when other user close the tab
$cmdname != "quit" &&
+ $cmdname != "nocensor" &&
$cmdname != "privmsg2")
{
// alert the other from the new pv
View
74 src/proxies/censor.class.php
@@ -32,42 +32,44 @@ class pfcProxyCommand_censor extends pfcProxyCommand
{
function run(&$xml_reponse, $p)
{
- $clientid = $p["clientid"];
- $param = $p["param"];
- $sender = $p["sender"];
- $recipient = $p["recipient"];
- $recipientid = $p["recipientid"];
-
- $c =& pfcGlobalConfig::Instance();
- $u =& pfcUserConfig::Instance();
+ $clientid = $p["clientid"];
+ $param = $p["param"];
+ $sender = $p["sender"];
+ $recipient = $p["recipient"];
+ $recipientid = $p["recipientid"];
+
+ $c =& pfcGlobalConfig::Instance();
+ $u =& pfcUserConfig::Instance();
+ if(!isset($_SESSION["nocensor"]) || !$_SESSION["nocensor"]) {
- $cmdtocheck = array("send", "nick", "me");
- if ( in_array($this->name, $cmdtocheck) )
- {
- $words = $c->proxies_cfg[$this->proxyname]["words"];
- $replaceby = $c->proxies_cfg[$this->proxyname]["replaceby"];
- $regex = $c->proxies_cfg[$this->proxyname]["regex"];
-
- $patterns = array();
- $replacements = array();
- foreach($words as $w)
- {
- if ($regex)
- {
- // the words are regular expressions
- $patterns[] = "/".$w."/ie";
- $replacements[] = "'\\1'.str_repeat('$replaceby',strlen('\\2')).'\\3'";
- }
- else
- {
- // the words are simple words
- $patterns[] = "/".preg_quote($w)."/i";
- $replacements[] = str_repeat($replaceby,strlen($w));
- }
- }
- $param = preg_replace($patterns, $replacements, $param);
- }
-
+ $cmdtocheck = array("send", "nick", "me");
+
+ if ( in_array($this->name, $cmdtocheck) )
+ {
+ $words = $c->proxies_cfg[$this->proxyname]["words"];
+ $replaceby = $c->proxies_cfg[$this->proxyname]["replaceby"];
+ $regex = $c->proxies_cfg[$this->proxyname]["regex"];
+
+ $patterns = array();
+ $replacements = array();
+ foreach($words as $w)
+ {
+ if ($regex)
+ {
+ // the words are regular expressions
+ $patterns[] = "/".$w."/ie";
+ $replacements[] = "'\\1'.str_repeat('$replaceby',strlen('\\2')).'\\3'";
+ }
+ else
+ {
+ // the words are simple words
+ $patterns[] = "/".preg_quote($w)."/i";
+ $replacements[] = str_repeat($replaceby,strlen($w));
+ }
+ }
+ $param = preg_replace($patterns, $replacements, $param);
+ }
+ }
// forward the command to the next proxy or to the final command
$p["clientid"] = $clientid;
$p["param"] = $param;
@@ -78,4 +80,4 @@ function run(&$xml_reponse, $p)
}
}
-?>
+?>
View
9 themes/default/chat.html.tpl.php
@@ -100,7 +100,14 @@
</div>
<?php } ?>
- </div>
+ <div class="pfc_btn">
+ <img src="<?php echo $c->getFileUrlFromTheme('smileys/emoticon_evilgrin.png'); ?>"
+ alt="Disable censorship" title=""
+ id="pfc_nocensor"
+ onclick="pfc.toggleCensor()" />
+ </div>
+
+ </div>
<div id="pfc_bbcode_container">
<div id="pfc_bt_strong_btn" class="pfc_btn">
Please sign in to comment.
Something went wrong with that request. Please try again.