make int channel accessable for everyone again

This commit is contained in:
HF 2021-01-31 22:22:40 +01:00
parent fb4ee3e83d
commit 755bd67a12
3 changed files with 1053 additions and 51 deletions

View File

@ -3,57 +3,57 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: src/core/ChatProvider.js:243 #: src/core/ChatProvider.js:301
msgid "You can not send chat messages with proxy" msgid "You can not send chat messages with proxy"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:248 #: src/core/ChatProvider.js:306
msgid "Couldn't send your message, pls log out and back in again." msgid "Couldn't send your message, pls log out and back in again."
msgstr "" msgstr ""
#: src/core/ChatProvider.js:262 #: src/core/ChatProvider.js:320
#, javascript-format #, javascript-format
msgid "You are sending messages too fast, you have to wait ${ waitTime }s :(" msgid "You are sending messages too fast, you have to wait ${ waitTime }s :("
msgstr "" msgstr ""
#: src/core/ChatProvider.js:266 #: src/core/ChatProvider.js:324
msgid "You don't have access to this channel" msgid "You don't have access to this channel"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:282 #: src/core/ChatProvider.js:340
msgid "Your mail has to be verified in order to chat" msgid "Your mail has to be verified in order to chat"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:287 #: src/core/ChatProvider.js:345
msgid "You are permanently muted, join our guilded to apppeal the mute" msgid "You are permanently muted, join our guilded to apppeal the mute"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:292 #: src/core/ChatProvider.js:350
#, javascript-format #, javascript-format
msgid "You are muted for another ${ timeMin } minutes" msgid "You are muted for another ${ timeMin } minutes"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:294 #: src/core/ChatProvider.js:352
msgid "You are muted for another ${ muted } seconds" msgid "You are muted for another ${ muted } seconds"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:302 #: src/core/ChatProvider.js:360
msgid "Ow no! Spam protection decided to mute you" msgid "Ow no! Spam protection decided to mute you"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:313 #: src/core/ChatProvider.js:371
msgid "You can't send a message this long :(" msgid "You can't send a message this long :("
msgstr "" msgstr ""
#: src/core/ChatProvider.js:317 #: src/core/ChatProvider.js:375
msgid "Please use int channel" msgid "Please use int channel"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:321 #: src/core/ChatProvider.js:379
msgid "Your country is temporary muted from chat" msgid "Your country is temporary muted from chat"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:329 #: src/core/ChatProvider.js:387
msgid "Stop flooding." msgid "Stop flooding."
msgstr "" msgstr ""
@ -294,6 +294,21 @@ msgstr ""
msgid "You are not even logged in." msgid "You are not even logged in."
msgstr "" msgstr ""
#: src/routes/api/auth/verify.js:25
#: src/routes/api/auth/verify.js:32
msgid "Mail verification"
msgstr ""
#: src/routes/api/auth/verify.js:26
msgid "You are now verified :)"
msgstr ""
#: src/routes/api/auth/verify.js:32
msgid ""
"Your mail verification code is invalid or already expired :(, please "
"request a new one."
msgstr ""
#: src/routes/api/auth/register.js:31 #: src/routes/api/auth/register.js:31
msgid "E-Mail already in use." msgid "E-Mail already in use."
msgstr "" msgstr ""
@ -310,21 +325,6 @@ msgstr ""
msgid "Failed to establish session after register :(" msgid "Failed to establish session after register :("
msgstr "" msgstr ""
#: src/routes/api/auth/verify.js:25
#: src/routes/api/auth/verify.js:32
msgid "Mail verification"
msgstr ""
#: src/routes/api/auth/verify.js:26
msgid "You are now verified :)"
msgstr ""
#: src/routes/api/auth/verify.js:32
msgid ""
"Your mail verification code is invalid or already expired :(, please "
"request a new one."
msgstr ""
#: src/ssr-components/RedirectionPage.jsx:20 #: src/ssr-components/RedirectionPage.jsx:20
msgid "You will be automatically redirected after 15s" msgid "You will be automatically redirected after 15s"
msgstr "" msgstr ""

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,6 @@ export class ChatProvider {
this.defaultChannels = {}; this.defaultChannels = {};
this.langChannels = {}; this.langChannels = {};
this.enChannelId = 0; this.enChannelId = 0;
this.intChannel = {};
this.infoUserId = 1; this.infoUserId = 1;
this.eventUserId = 1; this.eventUserId = 1;
this.caseCheck = /^[A-Z !.]*$/; this.caseCheck = /^[A-Z !.]*$/;
@ -64,17 +63,11 @@ export class ChatProvider {
if (name === 'en') { if (name === 'en') {
this.enChannelId = id; this.enChannelId = id;
} }
if (name === 'int') { this.defaultChannels[id] = [
this.intChannel = { name,
[id]: [name, type, lastTs], type,
}; lastTs,
} else { ];
this.defaultChannels[id] = [
name,
type,
lastTs,
];
}
} }
// find or create non-english lang channels // find or create non-english lang channels
const langs = Object.keys(ttags); const langs = Object.keys(ttags);
@ -129,7 +122,7 @@ export class ChatProvider {
} }
getDefaultChannels(lang) { getDefaultChannels(lang) {
let langChannel = {}; const langChannel = {};
if (lang && lang !== 'default') { if (lang && lang !== 'default') {
const { langChannels } = this; const { langChannels } = this;
if (langChannels[lang]) { if (langChannels[lang]) {
@ -137,8 +130,6 @@ export class ChatProvider {
id, type, lastTs, id, type, lastTs,
} = langChannels[lang]; } = langChannels[lang];
langChannel[id] = [lang, type, lastTs]; langChannel[id] = [lang, type, lastTs];
} else {
langChannel = this.intChannel;
} }
} }
return { return {
@ -177,19 +168,14 @@ export class ChatProvider {
if (this.defaultChannels[cid]) { if (this.defaultChannels[cid]) {
return true; return true;
} }
if (user.channels[cid]) {
return true;
}
const { lang } = user; const { lang } = user;
if (this.langChannels[lang] if (this.langChannels[lang]
&& this.langChannels[lang].id === cid) { && this.langChannels[lang].id === cid) {
return true; return true;
} }
if (this.intChannel[cid]
&& user.lang !== 'default'
&& !this.langChannels[user.lang]) {
return true;
}
if (user.channels[cid]) {
return true;
}
return false; return false;
} }