Commit d3e8ff8f authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #3472 Added facebook, diaspora and g+

parent 112233e6
......@@ -61,6 +61,16 @@ class socialHandler
}
}
class socialHandler_facebook extends socialHandler
{
static function getName()
{
return _('Facebook');
}
protected $baseurl = 'https://www.facebook.com';
}
class socialHandler_twitter extends socialHandler
{
static function getName()
......@@ -80,3 +90,46 @@ class socialHandler_twitter extends socialHandler
return preg_replace('/^@/', '', $value);
}
}
class socialHandler_gplus extends socialHandler
{
static function getName()
{
return _('Google+');
}
protected $baseurl = 'https://plus.google.com';
function linkify($value)
{
return $this->link($this->baseurl.'/+'.$value, '+'.$value);
}
function validate($value)
{
return preg_replace('/^+/', '', $value);
}
}
class socialHandler_diaspora extends socialHandler
{
static function getName()
{
return _('Diaspora*');
}
protected $baseurl = '';
function linkify($value)
{
return $value;
}
function validate($value)
{
if (!tests::is_email($value)) {
throw new socialHandlerInvalidValueException(_('Diaspora accounts must look like user@pod'));
}
return $value;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment