forked from GNUsocial/gnu-social
IM cleanup on 1.0.x branch:
* Fake_XMPP back to Queued_XMPP, refactor how we use it and don't create objects and load classes until we need them. * fix fatal error in IM settings while waiting for a Jabber confirmation. * Caching fix for user_im_prefs * fix for saving multiple transport settings * some fixes for AIM & using normalized addresses for lookups
This commit is contained in:
@@ -107,10 +107,15 @@ abstract class ImPlugin extends Plugin
|
||||
* receive a raw message
|
||||
* Raw IM data is taken from the incoming queue, and passed to this function.
|
||||
* It should parse the raw message and call handle_incoming()
|
||||
*
|
||||
* Returning false may CAUSE REPROCESSING OF THE QUEUE ITEM, and should
|
||||
* be used for temporary failures only. For permanent failures such as
|
||||
* unrecognized addresses, return true to indicate your processing has
|
||||
* completed.
|
||||
*
|
||||
* @param object $data raw IM data
|
||||
*
|
||||
* @return boolean success value
|
||||
* @return boolean true if processing completed, false for temporary failures
|
||||
*/
|
||||
abstract function receive_raw_message($data);
|
||||
|
||||
@@ -185,9 +190,12 @@ abstract class ImPlugin extends Plugin
|
||||
*/
|
||||
function get_user_im_prefs_from_screenname($screenname)
|
||||
{
|
||||
if($user_im_prefs = User_im_prefs::pkeyGet( array('transport' => $this->transport, 'screenname' => $screenname) )){
|
||||
$user_im_prefs = User_im_prefs::pkeyGet(
|
||||
array('transport' => $this->transport,
|
||||
'screenname' => $this->normalize($screenname)));
|
||||
if ($user_im_prefs) {
|
||||
return $user_im_prefs;
|
||||
}else{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -203,9 +211,9 @@ abstract class ImPlugin extends Plugin
|
||||
function get_screenname($user)
|
||||
{
|
||||
$user_im_prefs = $this->get_user_im_prefs_from_user($user);
|
||||
if($user_im_prefs){
|
||||
if ($user_im_prefs) {
|
||||
return $user_im_prefs->screenname;
|
||||
}else{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -220,9 +228,12 @@ abstract class ImPlugin extends Plugin
|
||||
*/
|
||||
function get_user_im_prefs_from_user($user)
|
||||
{
|
||||
if($user_im_prefs = User_im_prefs::pkeyGet( array('transport' => $this->transport, 'user_id' => $user->id) )){
|
||||
$user_im_prefs = User_im_prefs::pkeyGet(
|
||||
array('transport' => $this->transport,
|
||||
'user_id' => $user->id));
|
||||
if ($user_im_prefs){
|
||||
return $user_im_prefs;
|
||||
}else{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user