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"
|
||||
"log"
|
||||
"net/url"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"g.arns.lt/zordsdavini/zordfsdb"
|
||||
"git.sr.ht/~adnano/go-gemini"
|
||||
"gitlab.com/clseibold/misfin-server/misfin_client"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -87,26 +85,11 @@ func ProcessMention(remoteUrl string, pageId string) (bool, error) {
|
|||
links,
|
||||
"\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(
|
||||
"[Misfin] %d %s\n",
|
||||
resp.Status,
|
||||
resp.Meta,
|
||||
) // Should print `20 <fingerprint>` if server is running
|
||||
err = SendMisfinMessage(message, ZORDSDAVINI_MISFIN)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue