summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-31 09:09:07 -1000
committerEvan Prodromou <evan@status.net>2010-01-09 10:02:07 -0800
commit1e7ec69190e089f89b57181d561e2df2c8bdd3b5 (patch)
treeedd92771a4371b47e8cd21c3f9a07bfd3caeaf8b /classes
parentf2a403589cc8858ec3d3ce70f09709f36277c348 (diff)
some formatting changes to make inblobs work
Diffstat (limited to 'classes')
-rw-r--r--classes/Inbox.php8
-rw-r--r--classes/User.php1
2 files changed, 6 insertions, 3 deletions
diff --git a/classes/Inbox.php b/classes/Inbox.php
index de48d7381..610b5fceb 100644
--- a/classes/Inbox.php
+++ b/classes/Inbox.php
@@ -56,7 +56,7 @@ class Inbox extends Memcached_DataObject
$inbox = new Inbox();
$inbox->query(sprintf('UPDATE inbox '.
- 'set notice_ids = concat(cast(%08x as binary(4)), '.
+ 'set notice_ids = concat(cast(0x%08x as binary(4)), '.
'substr(notice_ids, 1, 4092)) '.
'WHERE user_id = %d',
$notice_id, $user_id));
@@ -77,7 +77,7 @@ class Inbox extends Memcached_DataObject
$inbox = new Inbox();
$inbox->query(sprintf('UPDATE inbox '.
- 'set notice_ids = concat(cast(%08x as binary(4)), '.
+ 'set notice_ids = concat(cast(0x%08x as binary(4)), '.
'substr(notice_ids, 1, 4092)) '.
'WHERE user_id in (%s)',
$notice_id, implode(',', $boxcar)));
@@ -94,11 +94,13 @@ class Inbox extends Memcached_DataObject
return array();
}
- $ids = unpack('L*', $inbox->notice_ids);
+ $ids = unpack('N*', $inbox->notice_ids);
// XXX: handle since_id
// XXX: handle max_id
$ids = array_slice($ids, $offset, $limit);
+
+ return $ids;
}
}
diff --git a/classes/User.php b/classes/User.php
index 773723da4..bde3f71b9 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -296,6 +296,7 @@ class User extends Memcached_DataObject
$inbox = new Inbox();
$inbox->user_id = $user->id;
+ $inbox->notice_ids = '';
$result = $inbox->insert();