]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
nudge: only show it when other person has enabled it.
authormillette <millette@controlyourself.ca>
Mon, 17 Nov 2008 15:41:47 +0000 (10:41 -0500)
committermillette <millette@controlyourself.ca>
Mon, 17 Nov 2008 15:41:47 +0000 (10:41 -0500)
darcs-hash:20081117154147-099f7-cf844aabcc3866eaf42312050a959dbc7cb10ed9.gz

actions/nudge.php
actions/showstream.php

index 0f50e67ad71cebb36731a60ca7d96e59a0832eb8..2685774a5099d31aba6b051dbe1261bca7f0a68b 100644 (file)
@@ -36,7 +36,7 @@ class NudgeAction extends Action {
                $other = User::staticGet('nickname', $other_nickname);
                $this->notify($user, $other);
 
-               if (true || $this->boolean('ajax')) {
+               if ($this->boolean('ajax')) {
                        common_start_html('text/xml');
                        common_element_start('head');
                        common_element('title', null, _('Nudge sent'));
@@ -46,8 +46,9 @@ class NudgeAction extends Action {
                        common_element_end('body');
                        common_element_end('html');
                } else {
-                       common_redirect(common_local_url('nudge',
-                                                                                        array('nickname' => $user->nickname)));
+            // display a confirmation to the user
+                       common_redirect(common_local_url('showstream',
+                                                                                        array('nickname' => $other->nickname)));
                }
        }
 
index 56858b477d7eec3fcde95e91e2d2575863d14199..3b8f71114954f69090156792eba53951d8aa4827 100644 (file)
@@ -191,9 +191,11 @@ class ShowstreamAction extends StreamAction {
                        common_element('a', array('href' => common_local_url('newmessage', array('to' => $user->id))),
                                                   _('Send a message'));
             common_element_end('li');
-            common_element_start('li', array('id' => 'profile_nudge'));
-            common_nudge_form($user);
-            common_element_end('li');
+            if ($user->email && $user->emailnotifynudge) {
+                common_element_start('li', array('id' => 'profile_nudge'));
+                common_nudge_form($user);
+                common_element_end('li');
+            }
                }
         common_element_end('ul');