diff options
Diffstat (limited to 'plugins/Msn')
-rw-r--r-- | plugins/Msn/MsnPlugin.php | 29 | ||||
-rw-r--r-- | plugins/Msn/msnmanager.php | 3 |
2 files changed, 21 insertions, 11 deletions
diff --git a/plugins/Msn/MsnPlugin.php b/plugins/Msn/MsnPlugin.php index 8452f1522..f00333d72 100644 --- a/plugins/Msn/MsnPlugin.php +++ b/plugins/Msn/MsnPlugin.php @@ -58,7 +58,7 @@ class MsnPlugin extends ImPlugin { *
* @return string Name of service
*/
- function getDisplayName() {
+ public function getDisplayName() {
return _m('MSN');
}
@@ -68,7 +68,7 @@ class MsnPlugin extends ImPlugin { * @param string $screenname screenname to normalize
* @return string an equivalent screenname in normalized form
*/
- function normalize($screenname) {
+ public function normalize($screenname) {
$screenname = str_replace(" ","", $screenname);
return strtolower($screenname);
}
@@ -78,7 +78,7 @@ class MsnPlugin extends ImPlugin { *
* @return string Screenname
*/
- function daemon_screenname() {
+ public function daemon_screenname() {
return $this->user;
}
@@ -86,20 +86,21 @@ class MsnPlugin extends ImPlugin { * Validate (ensure the validity of) a screenname
*
* @param string $screenname screenname to validate
- *
* @return boolean
*/
- function validate($screenname) {
- //TODO Correct this for MSN screennames
- //if(preg_match('/^[a-z]\w{2,15}$/i', $screenname)) {
- return true;
+ public function validate($screenname) {
+ // RFC 2822 (simplified) regexp
+ if(preg_match('/[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i', $screenname)) {
+ return true;
+ } else {
+ return false;
+ }
}
/**
* Load related modules when needed
*
* @param string $cls Name of the class to be loaded
- *
* @return boolean hook value; true means continue processing, false means stop.
*/
public function onAutoload($cls) {
@@ -159,7 +160,7 @@ class MsnPlugin extends ImPlugin { /**
* Initialize plugin
*
- * @return void
+ * @return boolean
*/
public function initialize() {
if (!isset($this->user)) {
@@ -175,7 +176,13 @@ class MsnPlugin extends ImPlugin { return true;
}
- function onPluginVersion(&$versions) {
+ /**
+ * Get plugin information
+ *
+ * @param array $versions array to insert information into
+ * @return void
+ */
+ public function onPluginVersion(&$versions) {
$versions[] = array(
'name' => 'MSN',
'version' => STATUSNET_VERSION,
diff --git a/plugins/Msn/msnmanager.php b/plugins/Msn/msnmanager.php index 5b04995c1..66152f0d2 100644 --- a/plugins/Msn/msnmanager.php +++ b/plugins/Msn/msnmanager.php @@ -146,6 +146,7 @@ class MsnManager extends ImManager { * Passes it back to the queuing system
*
* @param array $data Data
+ * @return void
*/
private function handle_msn_message($data) {
$this->plugin->enqueue_incoming_raw($data);
@@ -156,6 +157,7 @@ class MsnManager extends ImManager { * Called by callback to log failure during connect
*
* @param void $data Not used (there to keep callback happy)
+ * @return void
*/
function handle_connect_failed($data) {
common_log(LOG_NOTICE, 'MSN connect failed, retrying');
@@ -165,6 +167,7 @@ class MsnManager extends ImManager { * Called by callback to log reconnection
*
* @param void $data Not used (there to keep callback happy)
+ * @return void
*/
function handle_reconnect($data) {
common_log(LOG_NOTICE, 'MSN reconnecting');
|