Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
J
jc
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 conteneur
Registre de modèles
Opération
Environnements
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é
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Alexandre MORIGNOT
jc
Validations
2796bba9
Valider
2796bba9
rédigé
8 years ago
par
Alexandre Morignot
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Fix newNick
parent
d29ae2d1
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
irc/events.go
+4
-2
4 ajouts, 2 suppressions
irc/events.go
irc/transport.go
+14
-3
14 ajouts, 3 suppressions
irc/transport.go
avec
18 ajouts
et
5 suppressions
irc/events.go
+
4
−
2
Voir le fichier @
2796bba9
...
...
@@ -12,10 +12,12 @@ import (
)
func
(
t
*
Transport
)
connected
(
client
*
irc
.
Conn
,
line
*
irc
.
Line
)
{
t
.
Logger
.
Printf
(
"%s is connected"
,
client
.
Me
()
.
Nick
)
nick
:=
t
.
getNick
(
client
)
t
.
Logger
.
Printf
(
"%s is connected"
,
nick
)
if
t
.
client
!=
client
{
// user's client
for
_
,
channel
:=
range
t
.
userChannels
[
client
.
Me
()
.
N
ick
]
{
for
_
,
channel
:=
range
t
.
userChannels
[
n
ick
]
{
log
.
Printf
(
"Join %s"
,
channel
)
client
.
Join
(
channel
)
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
irc/transport.go
+
14
−
3
Voir le fichier @
2796bba9
...
...
@@ -33,6 +33,7 @@ func New(name string, cfg map[string]interface{}) (jc.Transport, error) {
t
:=
&
Transport
{
cfg
:
cfg
,
connectionError
:
make
(
chan
error
),
realNicks
:
make
(
map
[
string
]
string
),
userClients
:
make
(
map
[
string
]
*
irc
.
Conn
),
userChannels
:
make
(
map
[
string
][]
string
),
...
...
@@ -110,7 +111,6 @@ func (t *Transport) newIrcConfig(nick string, cfg map[string]interface{}) (*irc.
}
func
(
t
*
Transport
)
newNick
(
nick
string
)
string
{
log
.
Printf
(
"new nick %s"
,
nick
)
realNick
,
ok
:=
t
.
realNicks
[
nick
]
if
!
ok
{
realNick
=
nick
...
...
@@ -118,7 +118,7 @@ func (t *Transport) newNick(nick string) string {
delete
(
t
.
realNicks
,
nick
)
}
newNick
:=
nick
+
"
^
"
newNick
:=
nick
+
"
_
"
t
.
realNicks
[
newNick
]
=
realNick
return
newNick
}
...
...
@@ -138,7 +138,7 @@ func (t *Transport) getIrcClient(cfg *irc.Config) *irc.Conn {
}
func
(
t
*
Transport
)
isUserDistant
(
user
string
)
bool
{
for
k
,
_
:=
range
t
.
userClient
s
{
for
k
,
_
:=
range
t
.
realNick
s
{
if
k
==
user
{
return
true
}
...
...
@@ -146,3 +146,14 @@ func (t *Transport) isUserDistant(user string) bool {
return
false
}
func
(
t
*
Transport
)
getNick
(
client
*
irc
.
Conn
)
string
{
ircNick
:=
client
.
Me
()
.
Nick
nick
,
ok
:=
t
.
realNicks
[
ircNick
]
if
ok
{
return
nick
}
else
{
return
ircNick
}
}
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
Veuillez vous
inscrire
ou vous
se connecter
pour commenter