]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
mark incoming notices as local or not
authorEvan Prodromou <evan@prodromou.name>
Tue, 22 Jul 2008 14:18:28 +0000 (10:18 -0400)
committerEvan Prodromou <evan@prodromou.name>
Tue, 22 Jul 2008 14:18:28 +0000 (10:18 -0400)
darcs-hash:20080722141828-84dde-160fe4582c1949af1f6b049b3336cad493e30510.gz

actions/newnotice.php
actions/postnotice.php
maildaemon.php
xmppdaemon.php

index a98829cd87f32d6005045289ee1bc6c4877c915a..bf5fd5bcc0f1f03514a346be2d7be0fca07419a9 100644 (file)
@@ -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');
index c86e095ff69cf5d520a3bc01c4ca23a21f473ff6..ab12277bbdd5fe734eed61290a52befdf05b2a43 100644 (file)
@@ -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;
index f6de49d8d3c5bdca5aed84f79b73bdbf9bc356b7..f8fd7c11aede6440a36a1538b5a9873b1387641c 100755 (executable)
@@ -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);
index 9389e6fc9d8433f5af817f27f7ea4a3d8beb775d..d2e609b4407a31fdd2808523356e8e65bc113cfb 100755 (executable)
@@ -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);