forked from GNUsocial/gnu-social
Adaptation of library almost complete.
Bot now signs in correctly when launched using startdaemons.sh
This commit is contained in:
parent
0a4738a806
commit
27e8cfd360
@ -91,11 +91,8 @@ class MsnPlugin extends ImPlugin {
|
|||||||
*/
|
*/
|
||||||
function validate($screenname) {
|
function validate($screenname) {
|
||||||
//TODO Correct this for MSN screennames
|
//TODO Correct this for MSN screennames
|
||||||
if(preg_match('/^[a-z]\w{2,15}$/i', $screenname)) {
|
//if(preg_match('/^[a-z]\w{2,15}$/i', $screenname)) {
|
||||||
return true;
|
return true;
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,7 +106,7 @@ class MsnPlugin extends ImPlugin {
|
|||||||
$dir = dirname(__FILE__);
|
$dir = dirname(__FILE__);
|
||||||
|
|
||||||
switch ($cls) {
|
switch ($cls) {
|
||||||
case 'Msn':
|
case 'MSN':
|
||||||
require_once(INSTALLDIR.'/plugins/Msn/extlib/phpmsnclass/msn.class.php');
|
require_once(INSTALLDIR.'/plugins/Msn/extlib/phpmsnclass/msn.class.php');
|
||||||
return false;
|
return false;
|
||||||
case 'MsnManager':
|
case 'MsnManager':
|
||||||
@ -179,12 +176,14 @@ class MsnPlugin extends ImPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onPluginVersion(&$versions) {
|
function onPluginVersion(&$versions) {
|
||||||
$versions[] = array('name' => 'MSN',
|
$versions[] = array(
|
||||||
'version' => STATUSNET_VERSION,
|
'name' => 'MSN',
|
||||||
'author' => 'Luke Fitzgerald',
|
'version' => STATUSNET_VERSION,
|
||||||
'homepage' => 'http://status.net/wiki/Plugin:MSN',
|
'author' => 'Luke Fitzgerald',
|
||||||
'rawdescription' =>
|
'homepage' => 'http://status.net/wiki/Plugin:MSN',
|
||||||
_m('The MSN plugin allows users to send and receive notices over the MSN network.'));
|
'rawdescription' =>
|
||||||
|
_m('The MSN plugin allows users to send and receive notices over the MSN network.')
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -95,11 +95,15 @@ class MsnManager extends ImManager {
|
|||||||
*/
|
*/
|
||||||
function connect() {
|
function connect() {
|
||||||
if (!$this->conn) {
|
if (!$this->conn) {
|
||||||
$this->conn = new MSN(array('user' => $this->plugin->user,
|
$this->conn = new MSN(
|
||||||
'password' => $this->plugin->password,
|
array(
|
||||||
'alias' => $this->plugin->nickname,
|
'user' => $this->plugin->user,
|
||||||
'psm' => 'Send me a message to post a notice',
|
'password' => $this->plugin->password,
|
||||||
'debug' => true));
|
'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("IMIn", array($this, 'handle_msn_message'));
|
||||||
$this->conn->registerHandler('Pong', array($this, 'update_ping_time'));
|
$this->conn->registerHandler('Pong', array($this, 'update_ping_time'));
|
||||||
$this->conn->registerHandler('ConnectFailed', array($this, 'handle_connect_failed'));
|
$this->conn->registerHandler('ConnectFailed', array($this, 'handle_connect_failed'));
|
||||||
@ -124,6 +128,7 @@ class MsnManager extends ImManager {
|
|||||||
|
|
||||||
$this->conn->sendPing();
|
$this->conn->sendPing();
|
||||||
$this->lastping = time();
|
$this->lastping = time();
|
||||||
|
$this->pingInterval = 50;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user