misfin send message #4
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
1fc8937144
commit
6f1ebb6377
1 changed files with 4 additions and 21 deletions
25
mention.go
25
mention.go
|
@ -9,14 +9,12 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"g.arns.lt/zordsdavini/zordfsdb"
|
"g.arns.lt/zordsdavini/zordfsdb"
|
||||||
"git.sr.ht/~adnano/go-gemini"
|
"git.sr.ht/~adnano/go-gemini"
|
||||||
"gitlab.com/clseibold/misfin-server/misfin_client"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -87,26 +85,11 @@ func ProcessMention(remoteUrl string, pageId string) (bool, error) {
|
||||||
links,
|
links,
|
||||||
"\n=> ",
|
"\n=> ",
|
||||||
)
|
)
|
||||||
certFile, err := os.ReadFile("./identities/alkierios_misfin.pem")
|
|
||||||
if err != nil {
|
|
||||||
return false, fmt.Errorf("[gemini-mentions] couldn't read misfin sert: %s", err)
|
|
||||||
}
|
|
||||||
client := misfin_client.Client{}
|
|
||||||
resp, err := client.SendWithCert("misfin://zordsdavini@arns.lt", certFile, certFile, message)
|
|
||||||
if err != nil {
|
|
||||||
return false, fmt.Errorf(
|
|
||||||
"[gemini-mentions] couldn't send misfin message\n%s\n%s\n%s",
|
|
||||||
message,
|
|
||||||
certFile,
|
|
||||||
err,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf(
|
err = SendMisfinMessage(message, ZORDSDAVINI_MISFIN)
|
||||||
"[Misfin] %d %s\n",
|
if err != nil {
|
||||||
resp.Status,
|
return false, err
|
||||||
resp.Meta,
|
}
|
||||||
) // Should print `20 <fingerprint>` if server is running
|
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue