]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/newnotice.php
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / actions / newnotice.php
index f677c49a96fc4de2fa160ecf5ad613dabbcd9dba..78480ababb069849508550141ee4c5df9862b78c 100644 (file)
@@ -182,17 +182,31 @@ class NewnoticeAction extends Action
             }
         }
 
-        $notice = Notice::saveNew($user->id, $content_shortened, 'web', 1,
-                                  ($replyto == 'false') ? null : $replyto);
+        $options = array('reply_to' => ($replyto == 'false') ? null : $replyto);
+
+        if ($user->shareLocation() && $this->arg('notice_data-geo')) {
+
+            $locOptions = Notice::locationOptions($this->trimmed('lat'),
+                                                  $this->trimmed('lon'),
+                                                  $this->trimmed('location_id'),
+                                                  $this->trimmed('location_ns'),
+                                                  $user->getProfile());
+
+            $options = array_merge($options, $locOptions);
+        }
+
+        $notice = Notice::saveNew($user->id, $content_shortened, 'web', $options);
 
         if (isset($upload)) {
             $upload->attachToNotice($notice);
         }
 
-        common_broadcast_notice($notice);
+
 
         if ($this->boolean('ajax')) {
-            $this->startHTML('text/xml;charset=utf-8');
+            header('Content-Type: text/xml;charset=utf-8');
+            $this->xw->startDocument('1.0', 'UTF-8');
+            $this->elementStart('html');
             $this->elementStart('head');
             $this->element('title', null, _('Notice posted'));
             $this->elementEnd('head');