Index: trunk/extensions/BotQuery/query.php |
— | — | @@ -126,13 +126,16 @@ |
127 | 127 | "Example: query.php?what=namespaces", |
128 | 128 | )), |
129 | 129 | 'userinfo' => array( 'genMetaUserInfo', true, |
130 | | - array( 'uiextended' ), |
131 | | - array( false ), |
| 130 | + array( 'uiisblocked', 'uihasmsg', 'uiextended' ), |
| 131 | + array( false, false, false ), |
132 | 132 | array( |
133 | | - "Information about current user", |
| 133 | + "Information about current user.", |
| 134 | + "The information will always include 'name' element, and optionally 'anonymous' or 'bot' flags.", |
134 | 135 | "Parameters supported:", |
| 136 | + "uiisblocked- If present, and current user or ip is blocked, a 'blocked' flag will be added.", |
| 137 | + "uihasmsg - If present, and current user or ip has messages waiting, a 'messages' flag will be added.", |
135 | 138 | "uiextended - If present, includes additional information such as rights and groups.", |
136 | | - "Example: query.php?what=userinfo&uiextended", |
| 139 | + "Example: query.php?what=userinfo&uiisblocked&uihasmsg&uiextended", |
137 | 140 | )), |
138 | 141 | 'recentchanges' => array( 'genMetaRecentChanges', true, |
139 | 142 | array( 'rcfrom', 'rclimit', 'rchide' ), |
— | — | @@ -666,13 +669,15 @@ |
667 | 670 | $meta['name'] = $wgUser->getName(); |
668 | 671 | if( $wgUser->isAnon() ) $meta['anonymous'] = ''; |
669 | 672 | if( $wgUser->isBot() ) $meta['bot'] = ''; |
670 | | - if( $wgUser->isBlocked() ) $meta[' blocked'] = ''; |
| 673 | + if( $uiisblocked && $wgUser->isBlocked() ) $meta['blocked'] = ''; |
| 674 | + if( $uihasmsg && $wgUser->getNewtalk() ) $meta['messages'] = ''; |
671 | 675 | if( $uiextended ) { |
672 | 676 | $meta['groups'] = $wgUser->getGroups(); |
673 | 677 | $meta['groups']['_element'] = 'g'; |
674 | 678 | $meta['rights'] = $wgUser->getRights(); |
675 | 679 | $meta['rights']['_element'] = 'r'; |
676 | 680 | } |
| 681 | + |
677 | 682 | $this->data['meta']['user'] = $meta; |
678 | 683 | $this->endProfiling($prop); |
679 | 684 | } |