Skip to content

Commit

Permalink
+ anonymous user
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Jul 28, 2024
1 parent 44804d1 commit 4e52413
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
13 changes: 9 additions & 4 deletions routine/20170515.signature_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ KEY_COUNT = '#count',
/**
* 非內容的元素。無正式具意義的
* token.type。若是遇到這一些元素,就跳過、不算是正式內容。例如章節標題不能算成內文,我們也不會在章節標題之後馬上就簽名;因此處理的時候,去掉最末尾的章節標題。
*
*
* @see CeL.wiki.is_meaningful_element()
*/
noncontent_type = {
Expand Down Expand Up @@ -1126,7 +1126,12 @@ function for_each_row(row) {
// 由使用者名稱來檢測匿名使用者/未註冊用戶 [[WP:IP]]
// [[m:Special:MyLanguage/Tech/News/2021/05]]
// 在diffs中,IPv6位址被寫成了小寫字母。這導致了死連結,因為Special:使用者貢獻只接受大寫的IP。這個問題已經被修正。
var is_IP_user = CeL.is_IP(row.user);
var is_anonymous_user = 'anon' in row;
if (false) {
is_anonymous_user = CeL.wiki.parse.user
.parse_temporary_username(row.user)
|| CeL.is_IP(row.user);
}

check_log
.push([
Expand All @@ -1137,7 +1142,7 @@ function for_each_row(row) {
"The user may have appended date and signature, but it is not clear. Still '''need to append signature for %1 %2'''"
// gettext_config:{"id":"need-to-append-signature-for-$1-$2"}
: "'''Need to append signature for %1 %2'''",
gettext(is_IP_user
gettext(is_anonymous_user
// gettext_config:{"id":"ip-user"}
? 'IP user'
// gettext_config:{"id":"user"}
Expand All @@ -1162,7 +1167,7 @@ function for_each_row(row) {
// {{subst:Unsigned|用戶名或IP|時間日期}}
.replace(/([\s\n]*)$/, '{{' + (using_subst ? 'subst:' : '')
+ 'Unsigned|' + row.user + '|' + get_parsed_time(row)
+ (is_IP_user ? '|IP=1' : '') + '}}'
+ (is_anonymous_user ? '|IP=1' : '') + '}}'
// + '<!-- Autosigned by ' + wiki.token.login_user_name + ' -->'
+ '$1');

Expand Down
4 changes: 3 additions & 1 deletion routine/20170915.topic_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,9 @@ function add_user_name_and_date_set(section, user_and_date_index) {
// TODO: link to diff
user_shown = (additional_attributes ? '| ' : '')
// 對於匿名IP用戶則顯示編輯紀錄。
+ (CeL.is_IP(user_name)
+ (CeL.wiki.parse.user.parse_temporary_username(user_name)
//
|| CeL.is_IP(user_name)
//
? '[[Special:Contributions/' : '[[User:') + user_name + '|'
//
Expand Down
2 changes: 1 addition & 1 deletion routine/20201008.fix_anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function filter_row(row) {

// There are too many vandalism by IP users...
// [[w:en:User talk:Kanashimi#Bot is now erroneously changing links and anchors]]
if ('anon' in row /*CeL.is_IP(row.user)*/) {
if ('anon' in row /* CeL.wiki.parse.user.parse_temporary_username(row.user) || CeL.is_IP(row.user) */) {
return;
}

Expand Down
3 changes: 3 additions & 0 deletions routine/20230418.Fix_redirected_wikilinks_of_templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ node 20230418.Fix_redirected_wikilinks_of_templates.js
TODO:
@see
模板連結與嵌入檢查 https://templatetransclusioncheck.toolforge.org/index.php
*/

'use strict';
Expand Down

0 comments on commit 4e52413

Please sign in to comment.