Compare commits
2 Commits
c0e330ea22
...
519e7bcf25
| Author | SHA1 | Date | |
|---|---|---|---|
| 519e7bcf25 | |||
| 4d69d95c88 |
14
main.go
14
main.go
@@ -22,6 +22,7 @@ import (
|
|||||||
|
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
|
"math/rand/v2"
|
||||||
"runtime"
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -136,6 +137,8 @@ func dropToSignInPage(err error) {
|
|||||||
|
|
||||||
p, _ := ensureConfig()
|
p, _ := ensureConfig()
|
||||||
os.WriteFile(filepath.Join(p, "lambda.toml"), b.Bytes(), 0644)
|
os.WriteFile(filepath.Join(p, "lambda.toml"), b.Bytes(), 0644)
|
||||||
|
|
||||||
|
|
||||||
window.SetVisible(false)
|
window.SetVisible(false)
|
||||||
main()
|
main()
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
@@ -168,11 +171,18 @@ func main() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Put 4 random characters in front of lambda
|
||||||
|
chars := "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZλ"
|
||||||
|
str := ""
|
||||||
|
for range 4 {
|
||||||
|
str = str + string(chars[rand.IntN(len(chars))])
|
||||||
|
}
|
||||||
|
|
||||||
config := xmpp.Config{
|
config := xmpp.Config{
|
||||||
TransportConfiguration: xmpp.TransportConfiguration{
|
TransportConfiguration: xmpp.TransportConfiguration{
|
||||||
Address: loadedConfig.Server,
|
Address: loadedConfig.Server,
|
||||||
},
|
},
|
||||||
Jid: loadedConfig.Username,
|
Jid: loadedConfig.Username + "/lambda."+str,
|
||||||
Credential: xmpp.Password(loadedConfig.Password),
|
Credential: xmpp.Password(loadedConfig.Password),
|
||||||
Insecure: loadedConfig.Insecure,
|
Insecure: loadedConfig.Insecure,
|
||||||
// StreamLogger: os.Stdout,
|
// StreamLogger: os.Stdout,
|
||||||
@@ -240,9 +250,11 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if m.Body == "" {
|
if m.Body == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
originator := jid.MustParse(m.From).Bare().String()
|
originator := jid.MustParse(m.From).Bare().String()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user