summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-22 10:18:28 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-22 10:18:28 -0400
commitb1282b1b9fd9997d15f127810f98117e01b72daa (patch)
tree2ae748186351a5b3a1d34ddf07a164afdb39bea3
parente1361cdf489fc87aecb84261c5e2b7b47ce9c829 (diff)
mark incoming notices as local or not
darcs-hash:20080722141828-84dde-160fe4582c1949af1f6b049b3336cad493e30510.gz
-rw-r--r--actions/newnotice.php3
-rw-r--r--actions/postnotice.php1
-rwxr-xr-xmaildaemon.php1
-rwxr-xr-xxmppdaemon.php1
4 files changed, 5 insertions, 1 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index a98829cd8..bf5fd5bcc 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -38,9 +38,10 @@ class NewnoticeAction extends Action {
$user = common_current_user();
assert($user); # XXX: maybe an error instead...
- $notice = DB_DataObject::factory('notice');
+ $notice = new Notice();
assert($notice);
$notice->profile_id = $user->id; # user id *is* profile id
+ $notice->is_local = 1;
$notice->created = DB_DataObject_Cast::dateTime();
# Default theme uses 'content' for something else
$notice->content = $this->trimmed('status_textarea');
diff --git a/actions/postnotice.php b/actions/postnotice.php
index c86e095ff..ab12277bb 100644
--- a/actions/postnotice.php
+++ b/actions/postnotice.php
@@ -75,6 +75,7 @@ class PostnoticeAction extends Action {
$notice = Notice::staticGet('uri', $notice_uri);
if (!$notice) {
$notice = new Notice();
+ $notice->is_local = 0;
$notice->profile_id = $remote_profile->id;
$notice->uri = $notice_uri;
$notice->content = $content;
diff --git a/maildaemon.php b/maildaemon.php
index f6de49d8d..f8fd7c11a 100755
--- a/maildaemon.php
+++ b/maildaemon.php
@@ -116,6 +116,7 @@ class MailerDaemon {
function add_notice($user, $msg) {
$notice = new Notice();
+ $notice->is_local = 1;
$notice->profile_id = $user->id;
$notice->content = trim(substr($msg, 0, 140));
$notice->rendered = common_render_content($notice->content, $notice);
diff --git a/xmppdaemon.php b/xmppdaemon.php
index 9389e6fc9..d2e609b44 100755
--- a/xmppdaemon.php
+++ b/xmppdaemon.php
@@ -224,6 +224,7 @@ class XMPPDaemon {
function add_notice(&$user, &$pl) {
$notice = new Notice();
+ $notice->is_local = 1;
$notice->profile_id = $user->id;
$notice->content = trim(substr($pl['body'], 0, 140));
$notice->rendered = common_render_content($notice->content, $notice);