]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add a parameter named 'inreplyto' to the 'notice/new' page, so urls can inclue 'inrep...
authorCraig Andrews <candrews@integralblue.com>
Sat, 12 Sep 2009 02:37:37 +0000 (22:37 -0400)
committerCraig Andrews <candrews@integralblue.com>
Sat, 12 Sep 2009 02:37:37 +0000 (22:37 -0400)
actions/newnotice.php
lib/mail.php
lib/noticeform.php
lib/noticelist.php
lib/router.php

index 00a822860e5065a442eb40431b62fa87fec72c0f..6e3720e09ecee566d1a95d0f3feed8a07c6582ef 100644 (file)
@@ -431,13 +431,14 @@ class NewnoticeAction extends Action
         $content = $this->trimmed('status_textarea');
         if (!$content) {
             $replyto = $this->trimmed('replyto');
+            $inreplyto = $this->trimmed('inreplyto');
             $profile = Profile::staticGet('nickname', $replyto);
             if ($profile) {
                 $content = '@' . $profile->nickname . ' ';
             }
         }
 
-        $notice_form = new NoticeForm($this, '', $content);
+        $notice_form = new NoticeForm($this, '', $content, null, $inreplyto);
         $notice_form->show();
     }
 
index df585406cc87f11744e6bd98b81557f9c52689b7..432b7b329217143610b786819c5c5f806e4fff94 100644 (file)
@@ -629,7 +629,7 @@ function mail_notify_attn($user, $notice)
                     $notice->content,//%4
                                        $conversationUrl,//%5
                     common_local_url('newnotice',
-                                     array('replyto' => $sender->nickname)),//%6
+                                     array('replyto' => $sender->nickname, 'inreplyto' => $notice->id)),//%6
                     common_local_url('replies',
                                      array('nickname' => $user->nickname)),//%7
                     common_local_url('emailsettings'));//%8
index 1e3a45142c678d7cdf5fd3a89a47b39303dcf709..d1387b1b7c0f0dea1e7b4b26f96aed3799e48a6f 100644 (file)
@@ -69,6 +69,12 @@ class NoticeForm extends Form
 
     var $user = null;
 
+    /**
+     * The notice being replied to
+     */
+
+    var $inreplyto = null;
+
     /**
      * Constructor
      *
@@ -77,12 +83,13 @@ class NoticeForm extends Form
      * @param string        $content content to pre-fill
      */
 
-    function __construct($out=null, $action=null, $content=null, $user=null)
+    function __construct($out=null, $action=null, $content=null, $user=null, $inreplyto)
     {
         parent::__construct($out);
 
         $this->action  = $action;
         $this->content = $content;
+        $this->inreplyto = $inreplyto;
         
         if ($user) {
             $this->user = $user;
@@ -161,7 +168,7 @@ class NoticeForm extends Form
         if ($this->action) {
             $this->out->hidden('notice_return-to', $this->action, 'returnto');
         }
-        $this->out->hidden('notice_in-reply-to', $this->action, 'inreplyto');
+        $this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto');
     }
 
     /**
index ec85e4a5c1aec5c3448b3650c2dc2b88117f9512..6b2bccd9766b1a827ade6fbc99364408425b0a4a 100644 (file)
@@ -442,7 +442,7 @@ class NoticeListItem extends Widget
     {
         if (common_logged_in()) {
             $reply_url = common_local_url('newnotice',
-                                          array('replyto' => $this->profile->nickname));
+                                          array('replyto' => $this->profile->nickname, 'inreplyto' => $this->notice->id));
             $this->out->elementStart('a', array('href' => $reply_url,
                                                 'class' => 'notice_reply',
                                                 'title' => _('Reply to this notice')));
index 00e728f5571078b512c01b3da684d6b043ed36d6..0505c994210d96503b8761a2c82dcdf8d5b07e60 100644 (file)
@@ -175,6 +175,10 @@ class Router
         $m->connect('notice/new?replyto=:replyto',
                     array('action' => 'newnotice'),
                     array('replyto' => '[A-Za-z0-9_-]+'));
+        $m->connect('notice/new?replyto=:replyto&inreplyto=:inreplyto',
+                    array('action' => 'newnotice'),
+                    array('replyto' => '[A-Za-z0-9_-]+'),
+                    array('inreplyto' => '[0-9]+'));
 
         $m->connect('notice/:notice/file',
             array('action' => 'file'),