reference changes from stable 0.4.1
in AOCHat.php
find near line 616
<?php
function privategroup_join($group)
{
if(($gid = $this->get_uid($group)) === false)
{
return false;
}
return $this->send_packet(new AOChatPacket("out", AOCP_PRIVGRP_JOIN, $gid));
}
function join_privgroup($group) /* Deprecated - 2004/Mar/26 - auno@auno.org */
{
return $this->privategroup_join($group);
}
>
add after
<?php
function privategroup_leave($group)
{
if(($gid = $this->get_uid($group)) === false)
{
return false;
}
return $this->send_packet(new AOChatPacket("out", AOCP_PRIVGRP_PART, $gid));
}
>
in Bot.php
find near line 329
<?php
/*
send a tell. Set $low to 1 on tells that are likely to cause spam.
*/
function send_tell($to, $msg, $low=0, $color=true)
{
// parse all color tags:
$msg = $this -> colors -> parse($msg);
$send = true;
if (preg_match("/<a href=\"(.+)\">/isU", $msg, $info))
if (strlen($info[1]) > $this -> maxsize)
{
$this -> cut_size($msg, "tell", $to, $low);
$send = false;
}
if ($send)
{
$msg = str_replace("<botname>", $this -> botname, $msg);
$msg = str_replace("<pre>", str_replace("\\", "", $this -> commpre), $msg);
if ($color)
$msg = $this -> colors -> colorize("normal", $msg);
if ($this -> queue -> check_queue())
{
$this -> log("TELL", "OUT", "-> " . $this -> aoc -> get_uname($to) . ": " . $msg);
$msg = utf8_encode($msg);
$this -> aoc -> send_tell($to, $msg);
}
else
$this -> queue -> into_queue($to, $msg, "tell", $low);
}
}
>
and insert after
<?php
/*
accept invite to private group
*/
function send_pgroup_accept($group)
{
if ($group == NULL)
return false;
$this -> log("PGRP", "ACCEPT", "Accepting Invite for Private Group [" . $group . "]");
$this -> aoc -> privategroup_join($group);
}
/*
leave private group
*/
function send_pgroup_leave($group)
{
if ($group == NULL)
return false;
$this -> log("PGRP", "LEAVE", "Leaving Private Group [" . $group . "]");
$this -> aoc -> privategroup_leave($group);
}
/*
decline private group
*/
function send_pgroup_decline($group)
{
return $this->send_pgroup_leave($group);
}
>
in Bot.php
find near line 474
<?php
function send_output($source, $msg, $type)
{
// Output filter
if ($this -> settings -> get('Filter', 'Enabled'))
{
$msg = $this -> stringfilter -> output_filter($msg);
}
if (!is_numeric($type))
{
$type = strtolower($type);
}
switch($type)
{
case '0':
case '1':
case 'tell':
$this -> send_tell($source, $msg);
break;
case '2':
case 'pgroup':
case 'pgmsg':
$this -> send_pgroup($msg);
break;
case '3':
case 'gc':
$this -> send_gc($msg);
break;
case '4':
case 'both':
$this -> send_gc($msg);
$this -> send_pgroup($msg);
break;
default:
$this -> send_tell($source, "Broken plugin, type: $type is unknown to me");
}
}
>
change to
<?php
function send_output($source, $msg, $type)
{
// Output filter
if ($this -> settings -> get('Filter', 'Enabled'))
{
$msg = $this -> stringfilter -> output_filter($msg);
}
if (!is_numeric($type))
{
$type = strtolower($type);
}
switch($type)
{
case '0':
case '1':
case 'tell':
$this -> send_tell($source, $msg);
break;
case '2':
case 'pgroup':
case 'pgmsg':
$this -> send_pgroup($msg);
break;
case '3':
case 'gc':
$this -> send_gc($msg);
break;
case '4':
case 'both':
$this -> send_gc($msg);
$this -> send_pgroup($msg);
break;
case '5':
case 'extpgroup';
$this -> send_pgroup($msg, $source);
break;
default:
$this -> send_tell($source, "Broken plugin, type: $type is unknown to me");
}
}
>
yes it seems like duplication and you could directly access the aochat class but the goal is to promote good programming and blackbox style program.
if AOChat.php was every dramatically changed becuase FC changed some stuff module programmers would need to update there code, however following the model of programming only bot.php would need to be modified to allow any changes to work, thus maintaining a lot of backward module compatability