Index: trunk/extensions/WikiLove/WikiLove.php |
— | — | @@ -125,6 +125,7 @@ |
126 | 126 | 'wikilove-err-gallery', |
127 | 127 | 'wikilove-err-gallery-again', |
128 | 128 | 'wikilove-what-is-this', |
| 129 | + 'wikilove-anon-warning', |
129 | 130 | ), |
130 | 131 | 'dependencies' => array( |
131 | 132 | 'jquery.ui.dialog', |
Index: trunk/extensions/WikiLove/WikiLove.hooks.php |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | $out->addModules( 'ext.wikiLove.defaultOptions' ); |
73 | 73 | } |
74 | 74 | |
75 | | - self::$recipient = $title->getText(); |
| 75 | + self::$recipient = $title->getBaseText(); |
76 | 76 | } |
77 | 77 | return true; |
78 | 78 | } |
— | — | @@ -83,6 +83,12 @@ |
84 | 84 | global $wgUser; |
85 | 85 | $vars['wikilove-recipient'] = self::$recipient; |
86 | 86 | $vars['wikilove-edittoken'] = $wgUser->edittoken(); |
| 87 | + |
| 88 | + $vars['wikilove-anon'] = 0; |
| 89 | + if ( self::$recipient !== '' ) { |
| 90 | + $receiver = User::newFromName( self::$recipient ); |
| 91 | + if ( $receiver === false || $receiver->isAnon() ) $vars['wikilove-anon'] = 1; |
| 92 | + } |
87 | 93 | return true; |
88 | 94 | } |
89 | 95 | |
Index: trunk/extensions/WikiLove/WikiLove.api.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | global $wgUser; |
58 | 58 | $dbw = wfGetDB( DB_MASTER ); |
59 | 59 | $receiver = User::newFromName( $talk->getSubjectPage()->getBaseText() ); |
60 | | - if ( $receiver->isAnon() ) { |
| 60 | + if ( $receiver === false || $receiver->isAnon() ) { |
61 | 61 | $this->setWarning( 'Not logging anonymous recipients' ); |
62 | 62 | return; |
63 | 63 | } |
Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | <p><a target="_blank" href="http://www.mediawiki.org/wiki/WikiLove">\ |
61 | 61 | <html:msg key="wikilove-what-is-this"/>\ |
62 | 62 | </a></p>\ |
| 63 | + <p id="mw-wikilove-anon-warning"><strong><html:msg key="wikilove-anon-warning"/></strong></p>\ |
63 | 64 | </div>\ |
64 | 65 | <div id="mw-wikilove-add-details">\ |
65 | 66 | <span class="mw-wikilove-number">2</span>\ |
— | — | @@ -131,6 +132,8 @@ |
132 | 133 | $( '#mw-wikilove-send-form' ).click( $.wikiLove.submitSend ); |
133 | 134 | $( '#mw-wikilove-message' ).elastic(); // have the message textarea grow automatically |
134 | 135 | |
| 136 | + if ( mw.config.get( 'wikilove-anon' ) === 0 ) $( '#mw-wikilove-anon-warning' ).hide(); |
| 137 | + |
135 | 138 | // when the input changes, we want to disable the send button |
136 | 139 | $( '#mw-wikilove-header' ).change( $.wikiLove.changeInput ); |
137 | 140 | $( '#mw-wikilove-header' ).keyup( $.wikiLove.changeInput ); |
Index: trunk/extensions/WikiLove/WikiLove.i18n.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | 'wikilove-err-gallery-again' => 'Try again', |
49 | 49 | 'wikilove-summary' => '/* $1 */ new WikiLove message', |
50 | 50 | 'wikilove-what-is-this' => "What is this?", |
| 51 | + 'wikilove-anon-warning' => 'Note: This user is not registered, he or she many not notice this message.', |
51 | 52 | ); |
52 | 53 | |
53 | 54 | /** Message documentation (Message documentation) |