File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 250
250
"serverUnbanUser" : " Unban User from Server" ,
251
251
"userUnbanned" : " User unbanned successfully" ,
252
252
"userUnbanFailed" : " Unban failed!" ,
253
+ "globalUserUnbanFailed" : " Unban failed! Are you a global admin/mod?" ,
253
254
"banUser" : " Ban User" ,
254
255
"banUserAndDeleteAll" : " Ban and Delete All" ,
255
256
"serverBanUser" : " Ban User from Server" ,
256
257
"serverBanUserAndDeleteAll" : " Ban from Server and Delete All" ,
257
258
"userBanned" : " Banned successfully" ,
258
259
"userBanFailed" : " Ban failed!" ,
260
+ "GlobalUserBanFailed" : " Ban failed! Are you a global admin/mod?" ,
259
261
"leaveGroup" : " Leave Group" ,
260
262
"leaveAndRemoveForEveryone" : " Leave Group and Remove for Everyone" ,
261
263
"leaveGroupConfirmation" : " Are you sure you want to leave this group?" ,
Original file line number Diff line number Diff line change @@ -56,7 +56,13 @@ async function banOrUnBanUserCall(
56
56
if ( ! isChangeApplied ) {
57
57
window ?. log ?. warn ( `failed to ${ banType } user: ${ isChangeApplied } ` ) ;
58
58
59
- banType === 'ban' ? ToastUtils . pushUserBanFailure ( ) : ToastUtils . pushUserUnbanFailure ( ) ;
59
+ banType === 'ban'
60
+ ? isGlobal
61
+ ? ToastUtils . pushGlobalUserBanFailure ( )
62
+ : ToastUtils . pushUserBanFailure ( )
63
+ : isGlobal
64
+ ? ToastUtils . pushGlobalUserUnbanFailure ( )
65
+ : ToastUtils . pushUserUnbanFailure ( ) ;
60
66
return false ;
61
67
}
62
68
window ?. log ?. info ( `${ pubkey . key } user ${ banType } ned successfully...` ) ;
Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ export function pushUserBanFailure() {
117
117
pushToastError ( 'userBanFailed' , window . i18n ( 'userBanFailed' ) ) ;
118
118
}
119
119
120
+ export function pushGlobalUserBanFailure ( ) {
121
+ pushToastError ( 'globalUserBanFailed' , window . i18n ( 'globalUserBanFailed' ) ) ;
122
+ }
123
+
120
124
export function pushUserUnbanSuccess ( ) {
121
125
pushToastSuccess ( 'userUnbanned' , window . i18n ( 'userUnbanned' ) ) ;
122
126
}
@@ -125,6 +129,10 @@ export function pushUserUnbanFailure() {
125
129
pushToastError ( 'userUnbanFailed' , window . i18n ( 'userUnbanFailed' ) ) ;
126
130
}
127
131
132
+ export function pushGlobalUserUnbanFailure ( ) {
133
+ pushToastError ( 'globalUserUnbanFailed' , window . i18n ( 'globalUserUnbanFailed' ) ) ;
134
+ }
135
+
128
136
export function pushMessageDeleteForbidden ( ) {
129
137
pushToastError ( 'messageDeletionForbidden' , window . i18n ( 'messageDeletionForbidden' ) ) ;
130
138
}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ export type LocalizerKeys =
2
2
| 'removePassword'
3
3
| 'classicDarkThemeTitle'
4
4
| 'userUnbanFailed'
5
+ | 'globalUserUnbanFailed'
5
6
| 'changePassword'
6
7
| 'saved'
7
8
| 'startedACall'
@@ -39,6 +40,7 @@ export type LocalizerKeys =
39
40
| 'video'
40
41
| 'readReceiptSettingDescription'
41
42
| 'userBanFailed'
43
+ | 'globalUserBanFailed'
42
44
| 'autoUpdateLaterButtonLabel'
43
45
| 'maximumAttachments'
44
46
| 'deviceOnly'
You can’t perform that action at this time.
0 commit comments