add some icons and only store members by resource
This commit is contained in:
20
main.go
20
main.go
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
@@ -121,7 +122,7 @@ func main() {
|
||||
Jid: loadedConfig.Username + "/" + loadedConfig.Resource,
|
||||
Credential: xmpp.Password(loadedConfig.Password),
|
||||
Insecure: loadedConfig.Insecure,
|
||||
// StreamLogger: os.Stdout,
|
||||
StreamLogger: os.Stdout,
|
||||
StreamManagementEnable: true,
|
||||
}
|
||||
router := xmpp.NewRouter()
|
||||
@@ -282,10 +283,10 @@ func main() {
|
||||
|
||||
if ok { // This is a presence stanza from a user in a MUC
|
||||
presence.Get(&ocu)
|
||||
id := ocu.ID
|
||||
if id == "" {
|
||||
id = JidMustParse(presence.From).Resource
|
||||
}
|
||||
// id := ocu.ID
|
||||
// if id == "" {
|
||||
id := JidMustParse(presence.From).Resource
|
||||
// }
|
||||
from, _ := stanza.NewJid(presence.From)
|
||||
muc := from.Bare()
|
||||
_, ok = mucmembers.Load(muc)
|
||||
@@ -868,6 +869,15 @@ func activate(app *gtk.Application) {
|
||||
exts = append(exts, new_oob)
|
||||
}
|
||||
|
||||
if strings.Contains(t, "@everyone") {
|
||||
new_mention := new(Mention)
|
||||
new_mention.Mentions = "urn:xmpp:mentions:0#channel"
|
||||
exts = append(exts, new_mention)
|
||||
} else if strings.Contains(t, "@here") {
|
||||
new_attention := new(Attention)
|
||||
exts = append(exts, new_attention)
|
||||
}
|
||||
|
||||
err := sendMessage(client, current, message_type, t, "", "", exts)
|
||||
if err != nil {
|
||||
panic(err) // TODO: Show error message via GTK
|
||||
|
||||
Reference in New Issue
Block a user