]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fancy urls for show message, new message
authorEvan Prodromou <evan@controlyourself.ca>
Wed, 17 Sep 2008 18:02:44 +0000 (14:02 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Wed, 17 Sep 2008 18:02:44 +0000 (14:02 -0400)
darcs-hash:20080917180244-5ed1f-06e2ac2d8f094eacd12b316794b0599b57d76596.gz

actions/showstream.php
classes/User.php
htaccess.sample
lib/util.php

index af0bcb8097c5ac0496106becc5199a7e21de136b..9d871e41bfa241bb2346afbc5c4bcbb375acee7c 100644 (file)
@@ -150,7 +150,7 @@ class ShowstreamAction extends StreamAction {
                $user = User::staticGet('id', $profile->id);
                
                if ($cur->id != $user->id && $cur->mutuallySubscribed($user)) {
-                       common_element('a', array('href' => common_local_url('newmessage', array('nickname' => $user->nickname))),
+                       common_element('a', array('href' => common_local_url('newmessage', array('to' => $user->id))),
                                                   _('Send a message'));
                }
                
index 4305c15411d545510c393a7da285100430499909..1168406ef8e327f10ddf4dfd39c01c9b8d1d95aa 100644 (file)
@@ -117,7 +117,7 @@ class User extends DB_DataObject
                static $blacklist = array('rss', 'xrds', 'doc', 'main',
                                                                  'settings', 'notice', 'user',
                                                                  'search', 'avatar', 'tag', 'tags',
-                                                                 'api');
+                                                                 'api', 'message');
                $merged = array_merge($blacklist, common_config('nickname', 'blacklist'));
                return !in_array($nickname, $merged);
        }
index ce380666ec48cfc5f306baf9bf7ddb4cda31f0d7..de920de982abf6bb874037d44df37ada2fc48308 100644 (file)
@@ -54,6 +54,9 @@ RewriteRule ^notice/(\d+)$ index.php?action=shownotice&notice=$1 [L,QSA]
 RewriteRule ^notice/delete/((\d+))?$ index.php?action=deletenotice&notice=$2 [L,QSA]
 RewriteRule ^notice/delete$ index.php?action=deletenotice [L,QSA]
 
+RewriteRule ^message/new$ index.php?action=newmessage [L,QSA]
+RewriteRule ^message/(\d+)$ index.php?action=showmessage&id=$1 [L,QSA]
+
 RewriteRule ^user/(\d+)$ index.php?action=userbyid&id=$1 [L,QSA]
 
 RewriteRule ^tags/?$ index.php?action=tag [L,QSA]
index ac2f9af360c2fab819f3a1db345c7458f011147b..2fdcb37e396fffc9461e720667aa8bf32ac9dfa0 100644 (file)
@@ -934,6 +934,10 @@ function common_fancy_url($action, $args=NULL) {
                } else {
                        return common_path($args['nickname'].'/favorites');
                }
+        case 'showmessage':
+               return common_path('message/' . $args['id']);
+        case 'newmessage':
+               return common_path('message/new' . (($args) ? ('?' . http_build_query($args)) : ''));
         default:
                return common_simple_url($action, $args);
        }