Merge branch '376-allow-creation-of-new-direct-chat-using-matrix-id' into 'dev'
Resolve "Allow creation of new direct chat using matrix id" See merge request keanuapp/keanuapp-weblite!123
This commit is contained in:
commit
b6ee49e5f9
16 changed files with 251 additions and 180 deletions
|
|
@ -230,14 +230,17 @@
|
||||||
"confirm_text": ""
|
"confirm_text": ""
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"status_joining": "ཁ་བརྡ་ཁང་དུ་འཛུལ་བཞིན་པ།...",
|
|
||||||
"status_logging_in": "ནང་འཛུལ་བྱེད་བཞིན་པ།...",
|
|
||||||
"enter_room": "ནང་དུ་ཞུགས།",
|
|
||||||
"join": "ཁ་བརྡ་ཁང་དུ་འཛུལ།",
|
|
||||||
"joining_as": "ཁྱེད་རང་ཞུགས་བཞིན་པ།:",
|
|
||||||
"remember_me": "ང་དྲན་པར་བྱོས།",
|
|
||||||
"user_name_label": "སྤྱོད་མིང་།",
|
|
||||||
"title": "ཁྱེད་རང་ནང་དུ་ཞུགས་པར་དགའ་བསུ་ཞུ།",
|
"title": "ཁྱེད་རང་ནང་དུ་ཞུགས་པར་དགའ་བསུ་ཞུ།",
|
||||||
|
"title_user": "",
|
||||||
|
"user_name_label": "སྤྱོད་མིང་།",
|
||||||
|
"remember_me": "ང་དྲན་པར་བྱོས།",
|
||||||
|
"joining_as": "ཁྱེད་རང་ཞུགས་བཞིན་པ།:",
|
||||||
|
"join": "ཁ་བརྡ་ཁང་དུ་འཛུལ།",
|
||||||
|
"join_user": "",
|
||||||
|
"enter_room": "ནང་དུ་ཞུགས།",
|
||||||
|
"enter_room_user": "",
|
||||||
|
"status_logging_in": "ནང་འཛུལ་བྱེད་བཞིན་པ།...",
|
||||||
|
"status_joining": "ཁ་བརྡ་ཁང་དུ་འཛུལ་བཞིན་པ།...",
|
||||||
"join_failed": "ཁ་བརྡ་ཁང་དུ་འཛུལ་ཐུབ་མ་སོང་།",
|
"join_failed": "ཁ་བརྡ་ཁང་དུ་འཛུལ་ཐུབ་མ་སོང་།",
|
||||||
"choose_name": ""
|
"choose_name": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -164,11 +164,14 @@
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"title": "Welcome you have been invited to join",
|
"title": "Welcome you have been invited to join",
|
||||||
|
"title_user": "Welcome you have been invited to chat with",
|
||||||
"user_name_label": "User name",
|
"user_name_label": "User name",
|
||||||
"remember_me": "Remember me",
|
"remember_me": "Remember me",
|
||||||
"joining_as": "You are joining as:",
|
"joining_as": "You are joining as:",
|
||||||
"join": "Join room",
|
"join": "Join room",
|
||||||
|
"join_user": "Start chat",
|
||||||
"enter_room": "Enter room",
|
"enter_room": "Enter room",
|
||||||
|
"enter_room_user": "Start chat",
|
||||||
"status_logging_in": "Logging in...",
|
"status_logging_in": "Logging in...",
|
||||||
"status_joining": "Joining room...",
|
"status_joining": "Joining room...",
|
||||||
"join_failed": "Failed to join room.",
|
"join_failed": "Failed to join room.",
|
||||||
|
|
|
||||||
|
|
@ -63,14 +63,17 @@
|
||||||
"title": "Agregar Amigos"
|
"title": "Agregar Amigos"
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"status_joining": "Uniendose a la sala...",
|
|
||||||
"status_logging_in": "Iniciando sesión...",
|
|
||||||
"enter_room": "Entrar habitacion",
|
|
||||||
"join": "Unirse a la sala",
|
|
||||||
"joining_as": "Te estas uniendo como:",
|
|
||||||
"remember_me": "Recordarme",
|
|
||||||
"user_name_label": "Nombre de usuario",
|
|
||||||
"title": "Bienvenido has sido invitado a unirte",
|
"title": "Bienvenido has sido invitado a unirte",
|
||||||
|
"title_user": "",
|
||||||
|
"user_name_label": "Nombre de usuario",
|
||||||
|
"remember_me": "Recordarme",
|
||||||
|
"joining_as": "Te estas uniendo como:",
|
||||||
|
"join": "Unirse a la sala",
|
||||||
|
"join_user": "",
|
||||||
|
"enter_room": "Entrar habitacion",
|
||||||
|
"enter_room_user": "",
|
||||||
|
"status_logging_in": "Iniciando sesión...",
|
||||||
|
"status_joining": "Uniendose a la sala...",
|
||||||
"join_failed": "No se pudo unir a la sala.",
|
"join_failed": "No se pudo unir a la sala.",
|
||||||
"choose_name": ""
|
"choose_name": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -71,14 +71,17 @@
|
||||||
"invalid_message": ""
|
"invalid_message": ""
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"joining_as": "Liityt jäsenenä:",
|
|
||||||
"title": "Tervetuloa huoneen {roomName}",
|
"title": "Tervetuloa huoneen {roomName}",
|
||||||
"join_guest": "Liity vieraana",
|
"title_user": "",
|
||||||
"shared_computer": "Tämä on jaettu laite",
|
|
||||||
"join": "Liity huoneeseen",
|
|
||||||
"user_name_label": "Käyttäjätunnus",
|
"user_name_label": "Käyttäjätunnus",
|
||||||
"status_joining": "Liittyminen huoneeseen…",
|
"remember_me": "",
|
||||||
|
"joining_as": "Liityt jäsenenä:",
|
||||||
|
"join": "Liity huoneeseen",
|
||||||
|
"join_user": "",
|
||||||
|
"enter_room": "",
|
||||||
|
"enter_room_user": "",
|
||||||
"status_logging_in": "Kirjautuminen sisään…",
|
"status_logging_in": "Kirjautuminen sisään…",
|
||||||
|
"status_joining": "Liittyminen huoneeseen…",
|
||||||
"join_failed": "Huoneeseen liittyminen epäonnistui.",
|
"join_failed": "Huoneeseen liittyminen epäonnistui.",
|
||||||
"choose_name": ""
|
"choose_name": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -149,14 +149,17 @@
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"title": "Bienvenue dans {roomName}",
|
"title": "Bienvenue dans {roomName}",
|
||||||
|
"title_user": "",
|
||||||
"user_name_label": "Nom d’utilisateur",
|
"user_name_label": "Nom d’utilisateur",
|
||||||
"shared_computer": "Ceci est un appareil partagé",
|
"remember_me": "",
|
||||||
|
"joining_as": "Vous rejoignez en tant que :",
|
||||||
"join": "Rejoindre le salon",
|
"join": "Rejoindre le salon",
|
||||||
|
"join_user": "",
|
||||||
|
"enter_room": "",
|
||||||
|
"enter_room_user": "",
|
||||||
"status_logging_in": "Connexion en cours…",
|
"status_logging_in": "Connexion en cours…",
|
||||||
"status_joining": "Adhésion au salon…",
|
"status_joining": "Adhésion au salon…",
|
||||||
"join_failed": "Impossible de rejoindre le salon.",
|
"join_failed": "Impossible de rejoindre le salon.",
|
||||||
"joining_as": "Vous rejoignez en tant que :",
|
|
||||||
"join_guest": "Rejoindre comme invité·e",
|
|
||||||
"choose_name": ""
|
"choose_name": ""
|
||||||
},
|
},
|
||||||
"invite": {
|
"invite": {
|
||||||
|
|
|
||||||
|
|
@ -148,14 +148,17 @@
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"title": "Benvenuto/a in {roomName}",
|
"title": "Benvenuto/a in {roomName}",
|
||||||
|
"title_user": "",
|
||||||
"user_name_label": "Nome utente",
|
"user_name_label": "Nome utente",
|
||||||
"shared_computer": "Questo è un dispositivo condiviso",
|
"remember_me": "",
|
||||||
"joining_as": "Ti stai unendo come:",
|
"joining_as": "Ti stai unendo come:",
|
||||||
"join": "Unisciti alla stanza",
|
"join": "Unisciti alla stanza",
|
||||||
"join_guest": "Unisciti come ospite",
|
"join_user": "",
|
||||||
|
"enter_room": "",
|
||||||
|
"enter_room_user": "",
|
||||||
|
"status_logging_in": "Accesso in corso…",
|
||||||
"status_joining": "Unendosi alla stanza…",
|
"status_joining": "Unendosi alla stanza…",
|
||||||
"join_failed": "Impossibile unirsi alla stanza.",
|
"join_failed": "Impossibile unirsi alla stanza.",
|
||||||
"status_logging_in": "Accesso in corso…",
|
|
||||||
"choose_name": ""
|
"choose_name": ""
|
||||||
},
|
},
|
||||||
"invite": {
|
"invite": {
|
||||||
|
|
|
||||||
|
|
@ -79,11 +79,18 @@
|
||||||
"room_deleted": "Rom slettet."
|
"room_deleted": "Rom slettet."
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"join": "Ta del i rom",
|
|
||||||
"status_joining": "Tar del i rom…",
|
|
||||||
"status_logging_in": "Logger inn …",
|
|
||||||
"enter_room": "",
|
|
||||||
"title": "Velkommen til {roomName}",
|
"title": "Velkommen til {roomName}",
|
||||||
|
"title_user": "",
|
||||||
|
"user_name_label": "",
|
||||||
|
"remember_me": "",
|
||||||
|
"joining_as": "",
|
||||||
|
"join": "Ta del i rom",
|
||||||
|
"join_user": "",
|
||||||
|
"enter_room": "",
|
||||||
|
"enter_room_user": "",
|
||||||
|
"status_logging_in": "Logger inn …",
|
||||||
|
"status_joining": "Tar del i rom…",
|
||||||
|
"join_failed": "",
|
||||||
"choose_name": ""
|
"choose_name": ""
|
||||||
},
|
},
|
||||||
"profile_info_popup": {
|
"profile_info_popup": {
|
||||||
|
|
|
||||||
|
|
@ -177,11 +177,14 @@
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"title": "Bem-vindo, você foi convidado a participar",
|
"title": "Bem-vindo, você foi convidado a participar",
|
||||||
|
"title_user": "",
|
||||||
"user_name_label": "Nome do usuário",
|
"user_name_label": "Nome do usuário",
|
||||||
"remember_me": "Me lembre",
|
"remember_me": "Me lembre",
|
||||||
"joining_as": "Você está entrando como:",
|
"joining_as": "Você está entrando como:",
|
||||||
"join": "Entrar na sala",
|
"join": "Entrar na sala",
|
||||||
|
"join_user": "",
|
||||||
"enter_room": "Entre na sala",
|
"enter_room": "Entre na sala",
|
||||||
|
"enter_room_user": "",
|
||||||
"status_logging_in": "Fazendo login...",
|
"status_logging_in": "Fazendo login...",
|
||||||
"status_joining": "Entrando na sala...",
|
"status_joining": "Entrando na sala...",
|
||||||
"join_failed": "Houve uma falha ao entrar na sala.",
|
"join_failed": "Houve uma falha ao entrar na sala.",
|
||||||
|
|
|
||||||
|
|
@ -99,15 +99,18 @@
|
||||||
"title": "Adăugați prieteni"
|
"title": "Adăugați prieteni"
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"join_failed": "Nu a reușit să intre în cameră.",
|
|
||||||
"status_joining": "Intrarea în cameră...",
|
|
||||||
"status_logging_in": "Autentificare...",
|
|
||||||
"enter_room": "Intră în cameră",
|
|
||||||
"join": "Alăturați-vă camerei",
|
|
||||||
"joining_as": "Vă înscrieți ca:",
|
|
||||||
"remember_me": "Amintește-ți de mine",
|
|
||||||
"user_name_label": "Numele utilizatorului",
|
|
||||||
"title": "Bine ați venit, ați fost invitat să vă alăturați",
|
"title": "Bine ați venit, ați fost invitat să vă alăturați",
|
||||||
|
"title_user": "",
|
||||||
|
"user_name_label": "Numele utilizatorului",
|
||||||
|
"remember_me": "Amintește-ți de mine",
|
||||||
|
"joining_as": "Vă înscrieți ca:",
|
||||||
|
"join": "Alăturați-vă camerei",
|
||||||
|
"join_user": "",
|
||||||
|
"enter_room": "Intră în cameră",
|
||||||
|
"enter_room_user": "",
|
||||||
|
"status_logging_in": "Autentificare...",
|
||||||
|
"status_joining": "Intrarea în cameră...",
|
||||||
|
"join_failed": "Nu a reușit să intre în cameră.",
|
||||||
"choose_name": ""
|
"choose_name": ""
|
||||||
},
|
},
|
||||||
"profile_info_popup": {
|
"profile_info_popup": {
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,21 @@
|
||||||
"login": {
|
"login": {
|
||||||
"invalid_message": ""
|
"invalid_message": ""
|
||||||
},
|
},
|
||||||
|
"join": {
|
||||||
|
"title": "",
|
||||||
|
"title_user": "",
|
||||||
|
"user_name_label": "",
|
||||||
|
"remember_me": "",
|
||||||
|
"joining_as": "",
|
||||||
|
"join": "",
|
||||||
|
"join_user": "",
|
||||||
|
"enter_room": "",
|
||||||
|
"enter_room_user": "",
|
||||||
|
"status_logging_in": "",
|
||||||
|
"status_joining": "",
|
||||||
|
"join_failed": "",
|
||||||
|
"choose_name": ""
|
||||||
|
},
|
||||||
"logout": {
|
"logout": {
|
||||||
"confirm_text": ""
|
"confirm_text": ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,15 +121,18 @@
|
||||||
"confirm_text": ""
|
"confirm_text": ""
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"join_failed": "مۇنازىرە ئۆيىگە قوشۇلۇش مەغلۇب بولدى.",
|
|
||||||
"status_joining": "مۇنازىرىگە كىرىش...",
|
|
||||||
"status_logging_in": "كىرىش ...",
|
|
||||||
"enter_room": "",
|
|
||||||
"join": "مۇنازىرىگە قوشۇلۇڭ",
|
|
||||||
"joining_as": "سىز تۆۋەندىكىدەك قاتنىشىۋاتىسىز:",
|
|
||||||
"remember_me": "",
|
|
||||||
"user_name_label": "قوللانغۇچى ئىسمى",
|
|
||||||
"title": "{ياتاق ئىسمى} غا خۇش كەپسىز",
|
"title": "{ياتاق ئىسمى} غا خۇش كەپسىز",
|
||||||
|
"title_user": "",
|
||||||
|
"user_name_label": "قوللانغۇچى ئىسمى",
|
||||||
|
"remember_me": "",
|
||||||
|
"joining_as": "سىز تۆۋەندىكىدەك قاتنىشىۋاتىسىز:",
|
||||||
|
"join": "مۇنازىرىگە قوشۇلۇڭ",
|
||||||
|
"join_user": "",
|
||||||
|
"enter_room": "",
|
||||||
|
"enter_room_user": "",
|
||||||
|
"status_logging_in": "كىرىش ...",
|
||||||
|
"status_joining": "مۇنازىرىگە كىرىش...",
|
||||||
|
"join_failed": "مۇنازىرە ئۆيىگە قوشۇلۇش مەغلۇب بولدى.",
|
||||||
"choose_name": ""
|
"choose_name": ""
|
||||||
},
|
},
|
||||||
"room_welcome": {
|
"room_welcome": {
|
||||||
|
|
|
||||||
|
|
@ -179,14 +179,17 @@
|
||||||
"done": "完毕"
|
"done": "完毕"
|
||||||
},
|
},
|
||||||
"join": {
|
"join": {
|
||||||
"status_joining": "正在加入聊天室...",
|
|
||||||
"status_logging_in": "正在登录中...",
|
|
||||||
"enter_room": "加入聊天室",
|
|
||||||
"join": "加入聊天室",
|
|
||||||
"joining_as": "您以以下身份加入:",
|
|
||||||
"remember_me": "记得我",
|
|
||||||
"user_name_label": "用户名",
|
|
||||||
"title": "欢迎您被邀请加入",
|
"title": "欢迎您被邀请加入",
|
||||||
|
"title_user": "",
|
||||||
|
"user_name_label": "用户名",
|
||||||
|
"remember_me": "记得我",
|
||||||
|
"joining_as": "您以以下身份加入:",
|
||||||
|
"join": "加入聊天室",
|
||||||
|
"join_user": "",
|
||||||
|
"enter_room": "加入聊天室",
|
||||||
|
"enter_room_user": "",
|
||||||
|
"status_logging_in": "正在登录中...",
|
||||||
|
"status_joining": "正在加入聊天室...",
|
||||||
"join_failed": "加入聊天室失败。",
|
"join_failed": "加入聊天室失败。",
|
||||||
"choose_name": ""
|
"choose_name": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -6,25 +6,28 @@
|
||||||
<v-avatar class="join-avatar">
|
<v-avatar class="join-avatar">
|
||||||
<v-img v-if="roomAvatar" :src="roomAvatar" />
|
<v-img v-if="roomAvatar" :src="roomAvatar" />
|
||||||
<span v-else class="white--text headline">
|
<span v-else class="white--text headline">
|
||||||
{{roomName.substring(0, 1).toUpperCase() }}
|
{{ roomName.substring(0, 1).toUpperCase() }}
|
||||||
</span>
|
</span>
|
||||||
</v-avatar>
|
</v-avatar>
|
||||||
<div class="join-welcome font-weight-bold">
|
<div class="join-welcome font-weight-bold">
|
||||||
{{ $t("join.title") }}
|
{{ roomId && roomId.startsWith("@") ? $t("join.title_user") : $t("join.title") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="join-title">
|
<div class="join-title">
|
||||||
{{ roomName | removeHomeServer }}
|
{{ roomName }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr class="my-10 join-line">
|
<hr class="my-10 join-line" />
|
||||||
<div class="font-weight-black mb-2" v-if="!currentUser"> Choose a name to use.</div>
|
<div class="font-weight-black mb-2" v-if="!currentUser">Choose a name to use.</div>
|
||||||
|
|
||||||
<v-row v-if="canEditProfile">
|
<v-row v-if="canEditProfile">
|
||||||
<v-col cols="10" sm="7">
|
<v-col cols="10" sm="7">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
solo
|
solo
|
||||||
@click.native.stop="{}"
|
@click.native.stop="
|
||||||
|
{
|
||||||
|
}
|
||||||
|
"
|
||||||
v-model="selectedProfile.name"
|
v-model="selectedProfile.name"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
<v-checkbox
|
<v-checkbox
|
||||||
|
|
@ -47,34 +50,19 @@
|
||||||
<div class="d-inline-block">
|
<div class="d-inline-block">
|
||||||
<v-avatar color="#e0e0e0">
|
<v-avatar color="#e0e0e0">
|
||||||
<v-img v-if="userAvatar" :src="userAvatar" />
|
<v-img v-if="userAvatar" :src="userAvatar" />
|
||||||
<span v-else class="white--text headline">{{
|
<span v-else class="white--text headline">{{ userAvatarLetter }}</span>
|
||||||
userAvatarLetter
|
|
||||||
}}</span>
|
|
||||||
</v-avatar>
|
</v-avatar>
|
||||||
</div>
|
</div>
|
||||||
{{ userDisplayName }}
|
{{ userDisplayName }}
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<v-btn
|
<v-btn id="btn-join" class="btn-dark" large @click.stop="handleJoin" :loading="loading" v-if="!currentUser">{{
|
||||||
id="btn-join"
|
roomId && roomId.startsWith("@") ? $t("join.enter_room_user") : $t("join.enter_room")
|
||||||
class="btn-dark"
|
}}</v-btn>
|
||||||
large
|
<v-btn id="btn-join" class="btn-dark" large block @click.stop="handleJoin" :loading="loading" v-else>{{
|
||||||
@click.stop="handleJoin"
|
roomId && roomId.startsWith("@") ? $t("join.join_user") : $t("join.join")
|
||||||
:loading="loading"
|
}}</v-btn>
|
||||||
v-if="!currentUser"
|
|
||||||
>{{ $t("join.enter_room") }}</v-btn
|
|
||||||
>
|
|
||||||
<v-btn
|
|
||||||
id="btn-join"
|
|
||||||
class="btn-dark"
|
|
||||||
large
|
|
||||||
block
|
|
||||||
@click.stop="handleJoin"
|
|
||||||
:loading="loading"
|
|
||||||
v-else
|
|
||||||
>{{ $t("join.join") }}</v-btn
|
|
||||||
>
|
|
||||||
|
|
||||||
<div v-if="loadingMessage" class="text-center">{{ loadingMessage }}</div>
|
<div v-if="loadingMessage" class="text-center">{{ loadingMessage }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -86,33 +74,21 @@
|
||||||
<v-col v-for="lang in activeLanguage" :key="lang.value">
|
<v-col v-for="lang in activeLanguage" :key="lang.value">
|
||||||
<span class="active">{{ lang.text }}</span>
|
<span class="active">{{ lang.text }}</span>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col v-for="(lang, key) in getDisplayLanguage.slice(0,3)" :key="key">
|
<v-col v-for="(lang, key) in getDisplayLanguage.slice(0, 3)" :key="key">
|
||||||
<button class="inactive" @click="updateLanguage(lang.value)">{{ lang.text }}</button>
|
<button class="inactive" @click="updateLanguage(lang.value)">{{ lang.text }}</button>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-btn
|
<v-btn id="btn-select-language" class="language-more" @click="showSelectLanguageDialog = true">
|
||||||
id="btn-select-language"
|
<v-icon>language</v-icon><v-icon>more_horiz</v-icon>
|
||||||
class="language-more"
|
|
||||||
@click="showSelectLanguageDialog = true"
|
|
||||||
>
|
|
||||||
<v-icon >language</v-icon><v-icon >more_horiz</v-icon>
|
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
<SelectLanguageDialog
|
<SelectLanguageDialog v-model="showSelectLanguageDialog" v-on:close="showSelectLanguageDialog = false" />
|
||||||
v-model="showSelectLanguageDialog"
|
|
||||||
v-on:close="showSelectLanguageDialog = false"
|
|
||||||
/>
|
|
||||||
</v-row>
|
</v-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex justify-center align-center mt-9">
|
<div class="d-flex justify-center align-center mt-9">
|
||||||
<div class="mr-2">
|
<div class="mr-2">
|
||||||
<img
|
<img src="@/assets/logo.svg" width="32" height="32" class="d-inline" />
|
||||||
src="@/assets/logo.svg"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
class="d-inline"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<strong>{{ $t("project.name") }}</strong>
|
<strong>{{ $t("project.name") }}</strong>
|
||||||
|
|
@ -131,7 +107,7 @@ import SelectLanguageDialog from "./SelectLanguageDialog.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Join",
|
name: "Join",
|
||||||
mixins: [LanguageMixin,rememberMeMixin],
|
mixins: [LanguageMixin, rememberMeMixin],
|
||||||
components: {
|
components: {
|
||||||
SelectLanguageDialog,
|
SelectLanguageDialog,
|
||||||
},
|
},
|
||||||
|
|
@ -185,40 +161,23 @@ export default {
|
||||||
if (!this.$matrix.userAvatar) {
|
if (!this.$matrix.userAvatar) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return this.$matrix.matrixClient.mxcUrlToHttp(
|
return this.$matrix.matrixClient.mxcUrlToHttp(this.$matrix.userAvatar, 80, 80, "scale", true);
|
||||||
this.$matrix.userAvatar,
|
|
||||||
80,
|
|
||||||
80,
|
|
||||||
"scale",
|
|
||||||
true
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
userAvatarLetter() {
|
userAvatarLetter() {
|
||||||
if (!this.currentUser || !this.currentUser.userId) {
|
if (!this.currentUser || !this.currentUser.userId) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (
|
return (this.currentUserDisplayName || this.currentUser.userId.substring(1)).substring(0, 1).toUpperCase();
|
||||||
this.currentUserDisplayName || this.currentUser.userId.substring(1)
|
|
||||||
)
|
|
||||||
.substring(0, 1)
|
|
||||||
.toUpperCase();
|
|
||||||
},
|
},
|
||||||
getDisplayLanguage() {
|
getDisplayLanguage() {
|
||||||
let displayLanguages = [...this.getLanguages()];
|
let displayLanguages = [...this.getLanguages()];
|
||||||
return displayLanguages.filter(lang => lang.display && lang.value !== this.$i18n.locale);
|
return displayLanguages.filter((lang) => lang.display && lang.value !== this.$i18n.locale);
|
||||||
},
|
},
|
||||||
activeLanguage() {
|
activeLanguage() {
|
||||||
let activeLanguages = [...this.getLanguages()]
|
let activeLanguages = [...this.getLanguages()];
|
||||||
return activeLanguages.filter(lang => lang.value === this.$i18n.locale);
|
return activeLanguages.filter((lang) => lang.value === this.$i18n.locale);
|
||||||
}
|
},
|
||||||
},
|
|
||||||
filters: {
|
|
||||||
removeHomeServer(roomName) {
|
|
||||||
let lastIndexDash = roomName.lastIndexOf("-");
|
|
||||||
let lastIndex = lastIndexDash > 0 ? lastIndexDash : roomName.lastIndexOf(":");
|
|
||||||
return roomName ? roomName.substring(roomName.indexOf("#") + 1, lastIndex) : '';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
roomId: {
|
roomId: {
|
||||||
|
|
@ -227,10 +186,8 @@ export default {
|
||||||
if (!value || (value && value == oldVal)) {
|
if (!value || (value && value == oldVal)) {
|
||||||
return; // No change.
|
return; // No change.
|
||||||
}
|
}
|
||||||
console.log(
|
console.log("Join: Current room changed to " + (value ? value : "null"));
|
||||||
"Join: Current room changed to " + (value ? value : "null")
|
this.roomName = this.removeHomeServer(this.roomId);
|
||||||
);
|
|
||||||
this.roomName = this.roomId;
|
|
||||||
|
|
||||||
this.waitingForInfo = true;
|
this.waitingForInfo = true;
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
@ -243,10 +200,7 @@ export default {
|
||||||
const room = self.$matrix.getRoom(self.roomAliasOrId);
|
const room = self.$matrix.getRoom(self.roomAliasOrId);
|
||||||
|
|
||||||
// Already joined?
|
// Already joined?
|
||||||
if (
|
if (room && room.hasMembershipState(self.currentUser.user_id, "join")) {
|
||||||
room &&
|
|
||||||
room.hasMembershipState(self.currentUser.user_id, "join")
|
|
||||||
) {
|
|
||||||
// Yes, go to room
|
// Yes, go to room
|
||||||
self.$navigation.push(
|
self.$navigation.push(
|
||||||
{
|
{
|
||||||
|
|
@ -274,16 +228,21 @@ export default {
|
||||||
activeLanguage() {
|
activeLanguage() {
|
||||||
// Null status on language change, we don't know what status we are in so we can't get the right string.
|
// Null status on language change, we don't know what status we are in so we can't get the right string.
|
||||||
this.loadingMessage = null;
|
this.loadingMessage = null;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
removeHomeServer(roomName) {
|
||||||
|
let lastIndexDash = roomName.lastIndexOf("-");
|
||||||
|
let lastIndex = lastIndexDash > 0 ? lastIndexDash : roomName.lastIndexOf(":");
|
||||||
|
return roomName ? roomName.substring(roomName.indexOf("#") + 1, lastIndex) : "";
|
||||||
|
},
|
||||||
getRoomInfo() {
|
getRoomInfo() {
|
||||||
if (this.roomId.startsWith("#")) {
|
if (this.roomId.startsWith("#")) {
|
||||||
this.$matrix
|
this.$matrix
|
||||||
.getPublicRoomInfo(this.roomId)
|
.getPublicRoomInfo(this.roomId)
|
||||||
.then((room) => {
|
.then((room) => {
|
||||||
console.log("Found room:", room);
|
console.log("Found room:", room);
|
||||||
this.roomName = room.name;
|
this.roomName = this.removeHomeServer(room.name);
|
||||||
this.roomAvatar = room.avatar;
|
this.roomAvatar = room.avatar;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -292,11 +251,26 @@ export default {
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.waitingForInfo = false;
|
this.waitingForInfo = false;
|
||||||
});
|
});
|
||||||
|
} else if (this.roomId.startsWith("@")) {
|
||||||
|
// Direct chat with user
|
||||||
|
this.$matrix
|
||||||
|
.getPublicUserInfo(this.roomId)
|
||||||
|
.then((info) => {
|
||||||
|
console.log("Got user info:", info);
|
||||||
|
this.roomName = info.displayname;
|
||||||
|
this.roomAvatar = info.avatar;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log("Failed to get user info: ", err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.waitingForInfo = false;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// Private room, try to get name
|
// Private room, try to get name
|
||||||
const room = this.$matrix.getRoom(this.roomId);
|
const room = this.$matrix.getRoom(this.roomId);
|
||||||
if (room) {
|
if (room) {
|
||||||
this.roomName = room.name || this.roomName;
|
this.roomName = this.removeHomeServer(room.name || this.roomName);
|
||||||
}
|
}
|
||||||
this.waitingForInfo = false;
|
this.waitingForInfo = false;
|
||||||
}
|
}
|
||||||
|
|
@ -336,28 +310,16 @@ export default {
|
||||||
setProfileData = true;
|
setProfileData = true;
|
||||||
|
|
||||||
// Set display name and avatar directly on the matrix object.
|
// Set display name and avatar directly on the matrix object.
|
||||||
if (
|
if (this.selectedProfile.name && this.selectedProfile.name.length > 0) {
|
||||||
this.selectedProfile.name &&
|
|
||||||
this.selectedProfile.name.length > 0
|
|
||||||
) {
|
|
||||||
this.$matrix.userDisplayName = this.selectedProfile.name;
|
this.$matrix.userDisplayName = this.selectedProfile.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!setProfileData || !this.selectedProfile.name || this.selectedProfile.name.length == 0) {
|
||||||
!setProfileData ||
|
|
||||||
!this.selectedProfile.name ||
|
|
||||||
this.selectedProfile.name.length == 0
|
|
||||||
) {
|
|
||||||
return Promise.resolve(user);
|
return Promise.resolve(user);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log("Join: Set display name to: " + this.selectedProfile.name);
|
||||||
"Join: Set display name to: " + this.selectedProfile.name
|
return this.$matrix.matrixClient.setDisplayName(this.selectedProfile.name, undefined);
|
||||||
);
|
|
||||||
return this.$matrix.matrixClient.setDisplayName(
|
|
||||||
this.selectedProfile.name,
|
|
||||||
undefined
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
)
|
)
|
||||||
|
|
@ -368,24 +330,26 @@ export default {
|
||||||
return Promise.resolve("no avatar");
|
return Promise.resolve("no avatar");
|
||||||
} else {
|
} else {
|
||||||
console.log("Join: Updating avatar");
|
console.log("Join: Updating avatar");
|
||||||
return util.setAvatar(
|
return util.setAvatar(this.$matrix, this.selectedProfile.image, function (progress) {
|
||||||
this.$matrix,
|
console.log("Progress: " + JSON.stringify(progress));
|
||||||
this.selectedProfile.image,
|
});
|
||||||
function (progress) {
|
|
||||||
console.log("Progress: " + JSON.stringify(progress));
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
)
|
)
|
||||||
.then(
|
.then((ignoreduser) => {
|
||||||
function (ignoreduser) {
|
if (this.roomId.startsWith("@")) {
|
||||||
|
// start direct chat with user
|
||||||
|
return this.$matrix.getOrCreatePrivateChat(this.roomId).then((room) => {
|
||||||
|
this.$matrix.setCurrentRoomId(room.roomId);
|
||||||
|
return room;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
console.log("Join: joining room");
|
console.log("Join: joining room");
|
||||||
this.$analytics.event("Invitations", "Room Joined");
|
this.$analytics.event("Invitations", "Room Joined");
|
||||||
this.loadingMessage = this.$t("join.status_joining");
|
this.loadingMessage = this.$t("join.status_joining");
|
||||||
return this.$matrix.matrixClient.joinRoom(this.roomId);
|
return this.$matrix.matrixClient.joinRoom(this.roomId);
|
||||||
}.bind(this)
|
}
|
||||||
)
|
})
|
||||||
.then((ignoredRoom) => {
|
.then((ignoredRoom) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.loadingMessage = null;
|
this.loadingMessage = null;
|
||||||
|
|
@ -418,11 +382,7 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$matrix.on("Room.myMembership", this.onMyMembership);
|
this.$matrix.on("Room.myMembership", this.onMyMembership);
|
||||||
this.availableAvatars = util.getDefaultAvatars();
|
this.availableAvatars = util.getDefaultAvatars();
|
||||||
this.selectAvatar(
|
this.selectAvatar(this.availableAvatars[Math.floor(Math.random() * this.availableAvatars.length)]);
|
||||||
this.availableAvatars[
|
|
||||||
Math.floor(Math.random() * this.availableAvatars.length)
|
|
||||||
]
|
|
||||||
);
|
|
||||||
// mounted() is called more than once, so multiple instances of this event
|
// mounted() is called more than once, so multiple instances of this event
|
||||||
// do not necessarily indicate a user was shown the join page more than once.
|
// do not necessarily indicate a user was shown the join page more than once.
|
||||||
// To analyze this data, segment users into those who have an "Invitations"
|
// To analyze this data, segment users into those who have an "Invitations"
|
||||||
|
|
@ -431,10 +391,10 @@ export default {
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
this.$matrix.off("Room.myMembership", this.onMyMembership);
|
this.$matrix.off("Room.myMembership", this.onMyMembership);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@/assets/css/join.scss";
|
@import "@/assets/css/join.scss";
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -431,6 +431,13 @@ class Util {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sanitizeUserId(userId) {
|
||||||
|
if (userId && userId.match(/^@.+$/)) {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
getFirstVisibleElement(parentNode) {
|
getFirstVisibleElement(parentNode) {
|
||||||
const visible = this.findVisibleElements(parentNode);
|
const visible = this.findVisibleElements(parentNode);
|
||||||
if (visible && visible.length > 0) {
|
if (visible && visible.length > 0) {
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,11 @@ const routes = [
|
||||||
name: 'Join',
|
name: 'Join',
|
||||||
component: Join
|
component: Join
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/user/:userId?',
|
||||||
|
name: 'User',
|
||||||
|
component: Join
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/invite/:roomId?',
|
path: '/invite/:roomId?',
|
||||||
name: 'Invite',
|
name: 'Invite',
|
||||||
|
|
@ -113,6 +118,11 @@ router.beforeEach((to, from, next) => {
|
||||||
//Invite to public room
|
//Invite to public room
|
||||||
authRequired = false;
|
authRequired = false;
|
||||||
}
|
}
|
||||||
|
} else if (to.name == 'User') {
|
||||||
|
if (to.params.userId) {
|
||||||
|
const roomId = util.sanitizeUserId(to.params.userId);
|
||||||
|
router.app.$matrix.setCurrentRoomId(roomId);
|
||||||
|
}
|
||||||
} else if (to.name == 'Invite') {
|
} else if (to.name == 'Invite') {
|
||||||
if (to.params.roomId) {
|
if (to.params.roomId) {
|
||||||
const roomId = util.sanitizeRoomId(to.params.roomId);
|
const roomId = util.sanitizeRoomId(to.params.roomId);
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
onRoom(ignoredroom) {
|
onRoom(ignoredroom) {
|
||||||
console.log("Got room", ignoredroom);
|
|
||||||
this.reloadRooms();
|
this.reloadRooms();
|
||||||
this.updateNotificationCount();
|
this.updateNotificationCount();
|
||||||
},
|
},
|
||||||
|
|
@ -453,7 +452,6 @@ export default {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log("Reload rooms", updatedRooms);
|
|
||||||
Vue.set(this, "rooms", updatedRooms);
|
Vue.set(this, "rooms", updatedRooms);
|
||||||
const currentRoom = this.getRoom(this.$store.state.currentRoomId);
|
const currentRoom = this.getRoom(this.$store.state.currentRoomId);
|
||||||
if (this.currentRoom != currentRoom) {
|
if (this.currentRoom != currentRoom) {
|
||||||
|
|
@ -819,17 +817,12 @@ export default {
|
||||||
return this.matrixClient.uploadContent(file, opts);
|
return this.matrixClient.uploadContent(file, opts);
|
||||||
},
|
},
|
||||||
|
|
||||||
getPublicRoomInfo(roomId) {
|
/**
|
||||||
if (!roomId) {
|
* Get a matrix client that can be used for public queries. If we are logged in, this is the normal
|
||||||
return Promise.reject("Invalid parameters");
|
* matrix client. If not, we create a temp one with a temp password.
|
||||||
}
|
* @returns A MatrixClient that can be used for public queries
|
||||||
|
*/
|
||||||
const parts = roomId.split(":");
|
getPublicQueryMatrixClient() {
|
||||||
if (parts.length != 2) {
|
|
||||||
return Promise.reject("Unknown room server");
|
|
||||||
}
|
|
||||||
const server = parts[1];
|
|
||||||
|
|
||||||
var clientPromise;
|
var clientPromise;
|
||||||
if (this.matrixClient) {
|
if (this.matrixClient) {
|
||||||
clientPromise = this.getMatrixClient().then(() => {
|
clientPromise = this.getMatrixClient().then(() => {
|
||||||
|
|
@ -896,6 +889,55 @@ export default {
|
||||||
return matrixClient;
|
return matrixClient;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return clientPromise;
|
||||||
|
},
|
||||||
|
|
||||||
|
getPublicUserInfo(userId) {
|
||||||
|
if (!userId) {
|
||||||
|
return Promise.reject("Invalid parameters");
|
||||||
|
}
|
||||||
|
|
||||||
|
const parts = userId.split(":");
|
||||||
|
if (parts.length != 2) {
|
||||||
|
return Promise.reject("Unknown home server");
|
||||||
|
}
|
||||||
|
|
||||||
|
const clientPromise = this.getPublicQueryMatrixClient();
|
||||||
|
let matrixClient;
|
||||||
|
return clientPromise
|
||||||
|
.then((client) => {
|
||||||
|
matrixClient = client;
|
||||||
|
return client.getProfileInfo(userId);
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
if (response.avatar_url) {
|
||||||
|
response.avatar = matrixClient.mxcUrlToHttp(
|
||||||
|
response.avatar_url,
|
||||||
|
80,
|
||||||
|
80,
|
||||||
|
"scale",
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Promise.resolve(response);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
return Promise.reject("Failed to find user info: " + err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getPublicRoomInfo(roomId) {
|
||||||
|
if (!roomId) {
|
||||||
|
return Promise.reject("Invalid parameters");
|
||||||
|
}
|
||||||
|
|
||||||
|
const parts = roomId.split(":");
|
||||||
|
if (parts.length != 2) {
|
||||||
|
return Promise.reject("Unknown room server");
|
||||||
|
}
|
||||||
|
const server = parts[1];
|
||||||
|
|
||||||
|
const clientPromise = this.getPublicQueryMatrixClient();
|
||||||
|
|
||||||
const findOrGetMore = function _findOrGetMore(client, response) {
|
const findOrGetMore = function _findOrGetMore(client, response) {
|
||||||
for (var room of response.chunk) {
|
for (var room of response.chunk) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue