Adaptation of library almost complete.

Bot now signs in correctly when launched using startdaemons.sh
This commit is contained in:
Luke Fitzgerald 2010-06-15 20:51:04 +01:00
parent 0a4738a806
commit 27e8cfd360
3 changed files with 871 additions and 927 deletions

View File

@ -91,11 +91,8 @@ class MsnPlugin extends ImPlugin {
*/
function validate($screenname) {
//TODO Correct this for MSN screennames
if(preg_match('/^[a-z]\w{2,15}$/i', $screenname)) {
return true;
}else{
return false;
}
//if(preg_match('/^[a-z]\w{2,15}$/i', $screenname)) {
return true;
}
/**
@ -109,7 +106,7 @@ class MsnPlugin extends ImPlugin {
$dir = dirname(__FILE__);
switch ($cls) {
case 'Msn':
case 'MSN':
require_once(INSTALLDIR.'/plugins/Msn/extlib/phpmsnclass/msn.class.php');
return false;
case 'MsnManager':
@ -179,12 +176,14 @@ class MsnPlugin extends ImPlugin {
}
function onPluginVersion(&$versions) {
$versions[] = array('name' => 'MSN',
'version' => STATUSNET_VERSION,
'author' => 'Luke Fitzgerald',
'homepage' => 'http://status.net/wiki/Plugin:MSN',
'rawdescription' =>
_m('The MSN plugin allows users to send and receive notices over the MSN network.'));
$versions[] = array(
'name' => 'MSN',
'version' => STATUSNET_VERSION,
'author' => 'Luke Fitzgerald',
'homepage' => 'http://status.net/wiki/Plugin:MSN',
'rawdescription' =>
_m('The MSN plugin allows users to send and receive notices over the MSN network.')
);
return true;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -95,11 +95,15 @@ class MsnManager extends ImManager {
*/
function connect() {
if (!$this->conn) {
$this->conn = new MSN(array('user' => $this->plugin->user,
'password' => $this->plugin->password,
'alias' => $this->plugin->nickname,
'psm' => 'Send me a message to post a notice',
'debug' => true));
$this->conn = new MSN(
array(
'user' => $this->plugin->user,
'password' => $this->plugin->password,
'alias' => $this->plugin->nickname,
'psm' => 'Send me a message to post a notice',
'debug' => true
)
);
$this->conn->registerHandler("IMIn", array($this, 'handle_msn_message'));
$this->conn->registerHandler('Pong', array($this, 'update_ping_time'));
$this->conn->registerHandler('ConnectFailed', array($this, 'handle_connect_failed'));
@ -124,6 +128,7 @@ class MsnManager extends ImManager {
$this->conn->sendPing();
$this->lastping = time();
$this->pingInterval = 50;
return true;
}