summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-04-30 14:41:54 -0700
committerBrion Vibber <brion@pobox.com>2010-04-30 15:29:05 -0700
commit5414396a2ee9f1401d69b60969e04a1941e24e21 (patch)
tree5b6f503f01d6d8e3eda4e9cf26ce1a74d28473c0 /classes
parente3e90b4c27e27bbdd293767071dea3d7b5022046 (diff)
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
Diffstat (limited to 'classes')
-rw-r--r--classes/User_im_prefs.php23
-rw-r--r--classes/statusnet.ini6
2 files changed, 27 insertions, 2 deletions
diff --git a/classes/User_im_prefs.php b/classes/User_im_prefs.php
index 8ecdfe9fa..75be8969e 100644
--- a/classes/User_im_prefs.php
+++ b/classes/User_im_prefs.php
@@ -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;
+ }
+
}
diff --git a/classes/statusnet.ini b/classes/statusnet.ini
index d13fdfa52..b57d86226 100644
--- a/classes/statusnet.ini
+++ b/classes/statusnet.ini
@@ -647,8 +647,10 @@ modified = 384
[user_im_prefs__keys]
user_id = K
transport = K
-transport = U
-screenname = U
+; There's another unique index on (transport, screenname)
+; but we have no way to represent a compound index other than
+; the primary key in here. To ensure proper cache purging,
+; we need to tweak the class.
[user_urlshortener_prefs]
user_id = 129