Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
M
matrix-appservice-discord
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
salixor
matrix-appservice-discord
Validations
13694274
Non vérifiée
Valider
13694274
rédigé
22 févr. 2019
par
Sorunome
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
fix guild name sending and chanfix+ghostfix tools
parent
60f12c57
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
src/bot.ts
+1
-1
1 ajout, 1 suppression
src/bot.ts
tools/chanfix.ts
+5
-3
5 ajouts, 3 suppressions
tools/chanfix.ts
tools/ghostfix.ts
+2
-1
2 ajouts, 1 suppression
tools/ghostfix.ts
avec
8 ajouts
et
5 suppressions
src/bot.ts
+
1
−
1
Voir le fichier @
13694274
...
@@ -76,7 +76,7 @@ export class DiscordBot {
...
@@ -76,7 +76,7 @@ export class DiscordBot {
private
roomHandler
:
MatrixRoomHandler
;
private
roomHandler
:
MatrixRoomHandler
;
private
provisioner
:
Provisioner
;
private
provisioner
:
Provisioner
;
/* Caches */
/* Caches */
private
roomIdsForGuildCache
:
Map
<
string
,
{
roomIds
:
string
[],
ts
:
number
}
>
;
private
roomIdsForGuildCache
:
Map
<
string
,
{
roomIds
:
string
[],
ts
:
number
}
>
=
new
Map
()
;
/* Handles messages queued up to be sent to discord. */
/* Handles messages queued up to be sent to discord. */
private
discordMessageQueue
:
{
[
channelId
:
string
]:
Promise
<
void
>
};
private
discordMessageQueue
:
{
[
channelId
:
string
]:
Promise
<
void
>
};
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
tools/chanfix.ts
+
5
−
3
Voir le fichier @
13694274
...
@@ -80,8 +80,6 @@ const clientFactory = new ClientFactory({
...
@@ -80,8 +80,6 @@ const clientFactory = new ClientFactory({
token
:
registration
.
as_token
,
token
:
registration
.
as_token
,
url
:
config
.
bridge
.
homeserverUrl
,
url
:
config
.
bridge
.
homeserverUrl
,
});
});
const
discordstore
=
new
DiscordStore
(
config
.
database
?
config
.
database
.
filename
:
"
discord.db
"
);
const
discordbot
=
new
DiscordBot
(
""
,
config
,
null
,
discordstore
);
const
bridge
=
new
Bridge
({
const
bridge
=
new
Bridge
({
clientFactory
,
clientFactory
,
...
@@ -102,7 +100,11 @@ const bridge = new Bridge({
...
@@ -102,7 +100,11 @@ const bridge = new Bridge({
async
function
run
()
{
async
function
run
()
{
await
bridge
.
loadDatabases
();
await
bridge
.
loadDatabases
();
await
discordstore
.
init
();
const
store
=
new
DiscordStore
(
config
.
database
);
await
store
.
init
(
undefined
,
bridge
.
getRoomStore
());
const
discordbot
=
new
DiscordBot
(
botUserId
,
config
,
bridge
,
store
);
await
discordbot
.
init
();
bridge
.
_clientFactory
=
clientFactory
;
bridge
.
_clientFactory
=
clientFactory
;
bridge
.
_botClient
=
bridge
.
_clientFactory
.
getClientAs
();
bridge
.
_botClient
=
bridge
.
_clientFactory
.
getClientAs
();
bridge
.
_botIntent
=
new
Intent
(
bridge
.
_botClient
,
bridge
.
_botClient
,
{
registered
:
true
});
bridge
.
_botIntent
=
new
Intent
(
bridge
.
_botClient
,
bridge
.
_botClient
,
{
registered
:
true
});
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
tools/ghostfix.ts
+
2
−
1
Voir le fichier @
13694274
...
@@ -110,6 +110,7 @@ const bridge = new Bridge({
...
@@ -110,6 +110,7 @@ const bridge = new Bridge({
async
function
run
()
{
async
function
run
()
{
await
bridge
.
loadDatabases
();
await
bridge
.
loadDatabases
();
const
store
=
new
DiscordStore
(
config
.
database
);
const
store
=
new
DiscordStore
(
config
.
database
);
await
store
.
init
(
undefined
,
bridge
.
getRoomStore
());
const
discordbot
=
new
DiscordBot
(
botUserId
,
config
,
bridge
,
store
);
const
discordbot
=
new
DiscordBot
(
botUserId
,
config
,
bridge
,
store
);
await
discordbot
.
init
();
await
discordbot
.
init
();
bridge
.
_clientFactory
=
clientFactory
;
bridge
.
_clientFactory
=
clientFactory
;
...
@@ -128,7 +129,7 @@ async function run() {
...
@@ -128,7 +129,7 @@ async function run() {
let
currentSchedule
=
JOIN_ROOM_SCHEDULE
[
0
];
let
currentSchedule
=
JOIN_ROOM_SCHEDULE
[
0
];
const
doJoin
=
async
()
=>
{
const
doJoin
=
async
()
=>
{
await
Util
.
DelayedPromise
(
currentSchedule
);
await
Util
.
DelayedPromise
(
currentSchedule
);
await
discordbot
.
UserSyncroniser
.
OnUpdateGuildMember
(
member
,
true
);
await
discordbot
.
UserSyncroniser
.
OnUpdateGuildMember
(
member
,
true
,
false
);
};
};
const
errorHandler
=
async
(
err
)
=>
{
const
errorHandler
=
async
(
err
)
=>
{
log
.
error
(
`Error joining rooms for
${
member
.
id
}
`
);
log
.
error
(
`Error joining rooms for
${
member
.
id
}
`
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Please
se connecter
to comment