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:
Brion Vibber
2010-04-30 14:41:54 -07:00
parent e3e90b4c27
commit 5414396a2e
8 changed files with 89 additions and 37 deletions

View File

@@ -68,4 +68,27 @@ class User_im_prefs extends Memcached_DataObject
{
return array(false,false);
}
/**
* We have two compound keys with unique constraints:
* (transport, user_id) which is our primary key, and
* (transport, screenname) which is an additional constraint.
*
* Currently there's not a way to represent that second key
* in the general keys list, so we're adding it here to the
* list of keys to use for caching, ensuring that it gets
* cleared as well when we change.
*
* @return array of cache keys
*/
function _allCacheKeys()
{
$ukeys = 'transport,screenname';
$uvals = $this->transport . ',' . $this->screenname;
$ckeys = parent::_allCacheKeys();
$ckeys[] = $this->cacheKey($this->tableName(), $ukeys, $uvals);
return $ckeys;
}
}