Skip to content

Commit

Permalink
Isolate the kick/ban notices. Setup the flag 4 on the shownotice para…
Browse files Browse the repository at this point in the history
…meter to display only kick/ban notices.

git-svn-id: https://phpfreechat.svn.sourceforge.net/svnroot/phpfreechat/trunk@1263 2772adf2-ac07-0410-9d30-e29d8120292e
  • Loading branch information
kerphi committed Apr 26, 2009
1 parent 599f59d commit 7747526
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
$params["title"] = "Quick chat";
$params["nick"] = "guest".rand(1,1000); // setup the intitial nickname
$params['firstisadmin'] = true;
//$params["isadmin"] = true; // do not use it on production servers ;)
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = true;
$params["debug"] = false;
$chat = new phpFreeChat( $params );

?>
Expand Down
4 changes: 2 additions & 2 deletions src/commands/ban.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ function run(&$xml_reponse, $p)
// notify all the channel
$cmdp = $p;
$cmdp["param"] = _pfc("%s banished from %s by %s", $nick, $channame, $sender);
$cmdp["flag"] = 1;
$cmdp["flag"] = 4;
$cmd =& pfcCommand::Factory("notice");
$cmd->run($xml_reponse, $cmdp);

// kick the user (maybe in the future, it will be dissociate in a /kickban command)
// kick the user (maybe in the future, it will exists a /kickban command)
$cmdp = $p;
$cmdp["params"] = array();
$cmdp["params"][] = $nick; // nickname to kick
Expand Down
1 change: 1 addition & 0 deletions src/commands/kick.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function run(&$xml_reponse, $p)
$channame = $u->channels[$recipientid]["name"];
$cmdstr = 'leave';
$cmdp = array();
$cmdp['flag'] = 4;
$cmdp['params'][] = 'ch';
$cmdp['params'][] = $channame; // channel name
$cmdp['params'][] = _pfc("kicked from %s by %s - reason: %s", $channame, $sender, $reason); // reason
Expand Down
3 changes: 2 additions & 1 deletion src/commands/leave.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function run(&$xml_reponse, $p)
$sender = $p["sender"];
$recipient = $p["recipient"];
$recipientid = $p["recipientid"];
$flag = isset($p["flag"]) ? $p["flag"] : 2;

$c =& pfcGlobalConfig::Instance();
$u =& pfcUserConfig::Instance();
Expand Down Expand Up @@ -95,7 +96,7 @@ function run(&$xml_reponse, $p)
$cmdp = $p;
$cmdp["recipient"] = $leave_recip;
$cmdp["recipientid"] = $leave_id;
$cmdp["flag"] = 2;
$cmdp["flag"] = $flag;
$cmdp["param"] = _pfc("%s quit",$u->getNickname());
if ($reason != "") $cmdp["param"] .= " (".$reason.")";
$cmd =& pfcCommand::Factory("notice");
Expand Down
2 changes: 1 addition & 1 deletion src/commands/notice.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function run(&$xml_reponse, $p)
$sender = $p["sender"];
$recipient = $p["recipient"];
$recipientid = $p["recipientid"];
$flag = isset($p["flag"]) ? $p["flag"] : 3;
$flag = isset($p["flag"]) ? $p["flag"] : 7;

$c =& pfcGlobalConfig::Instance();
$u =& pfcUserConfig::Instance();
Expand Down
7 changes: 4 additions & 3 deletions src/pfcglobalconfig.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,11 @@ class pfcGlobalConfig
* <p><ul><li>Setting this to 0 will show nothing.</li>
* <li>Setting it to 1 will show nicknames changes.</li>
* <li>Setting it to 2 will show connect/disconnect notifications.</li>
* <li>Setting it to 3 (1+2) will show nicknames and connect/disconnect notifications.</li></ul>
* (Default value: 3)</p>
* <li>Setting it to 4 will show kick/ban notifications.</li>
* <li>Setting it to 7 (1+2+4) will show all the notifications.</li></ul>
* (Default value: 7)</p>
*/
var $shownotice = 3;
var $shownotice = 7;

/**
* <p>Setting it to false will disable nickname colorization.
Expand Down

0 comments on commit 7747526

Please sign in to comment.