AV hash custom nicks
This commit is contained in:
+24
-1
@@ -190,11 +190,34 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
||||
m.Get(&ocu)
|
||||
id := JidMustParse(m.From).Resource
|
||||
name := id
|
||||
|
||||
|
||||
// Avatar hash custom nicks. This code needs to be optimised.
|
||||
mo, ok := mucmembers.Load(JidMustParse(m.From).Bare())
|
||||
if ok {
|
||||
mm, ok := mo.(mucUnit)
|
||||
if ok {
|
||||
mmm, ok := mm.Members.Load(id)
|
||||
if ok {
|
||||
u := mmm.(stanza.Presence)
|
||||
var vcu VCardUpdate
|
||||
ok = u.Get(&vcu)
|
||||
if ok {
|
||||
av_nick, ok := loadedConfig.CustomNicksAV[vcu.Photo]
|
||||
if ok {
|
||||
name = av_nick
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
custom_nick, ok := loadedConfig.CustomNicks[ocu.ID]
|
||||
if ok {
|
||||
name = custom_nick
|
||||
}
|
||||
|
||||
|
||||
if name == "" {
|
||||
name = JidMustParse(m.From).Bare()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user