Unbreak function heads.

v0.6
Martin Dosch 1 year ago
parent a912408d16
commit aad725b721
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D

@ -21,9 +21,7 @@ import (
"github.com/mattn/go-xmpp" // BSD-3-Clause
)
func httpUpload(client *xmpp.Client, iqc chan xmpp.IQ,
jserver string, filePath string,
) string {
func httpUpload(client *xmpp.Client, iqc chan xmpp.IQ, jserver string, filePath string) string {
var uploadComponent string
var maxFileSize int64

28
ox.go

@ -19,9 +19,7 @@ import (
"github.com/mattn/go-xmpp" // BSD-3-Clause
)
func oxDeleteNodes(jid string, client *xmpp.Client,
iqc chan xmpp.IQ,
) error {
func oxDeleteNodes(jid string, client *xmpp.Client, iqc chan xmpp.IQ) error {
nodeListRequest := etree.NewDocument()
nodeListRequest.WriteSettings.AttrSingleQuote = true
query := nodeListRequest.CreateElement("query")
@ -73,9 +71,7 @@ func oxDeleteNodes(jid string, client *xmpp.Client,
return nil
}
func oxDecrypt(m xmpp.Chat, client *xmpp.Client, iqc chan xmpp.IQ,
user string, oxPrivKey *crypto.Key,
) (string, time.Time, error) {
func oxDecrypt(m xmpp.Chat, client *xmpp.Client, iqc chan xmpp.IQ, user string, oxPrivKey *crypto.Key) (string, time.Time, error) {
var cryptMsgByte []byte
var err error
sender := strings.Split(m.Remote, "/")[0]
@ -155,9 +151,7 @@ func isOxMsg(m xmpp.Chat) bool {
return false
}
func oxImportPrivKey(jid string, privKeyLocation string, client *xmpp.Client,
iqc chan xmpp.IQ,
) error {
func oxImportPrivKey(jid string, privKeyLocation string, client *xmpp.Client, iqc chan xmpp.IQ) error {
xmppURI := "xmpp:" + jid
buffer, err := readFile(privKeyLocation)
if errors.Unwrap(err) != nil {
@ -226,9 +220,7 @@ func oxImportPrivKey(jid string, privKeyLocation string, client *xmpp.Client,
return nil
}
func oxPublishPubKey(jid string, client *xmpp.Client, iqc chan xmpp.IQ,
pubKey *crypto.Key,
) error {
func oxPublishPubKey(jid string, client *xmpp.Client, iqc chan xmpp.IQ, pubKey *crypto.Key) error {
keyCreated := time.Now().UTC().Format("2006-01-02T15:04:05Z")
fingerprint := strings.ToUpper(pubKey.GetFingerprint())
keySerialized, err := pubKey.Serialize()
@ -490,9 +482,7 @@ func oxGenPrivKey(jid string, client *xmpp.Client, iqc chan xmpp.IQ,
return nil
}
func oxRecvPublicKeys(client *xmpp.Client, iqc chan xmpp.IQ, recipient string,
fingerprint string,
) (*crypto.KeyRing, error) {
func oxRecvPublicKeys(client *xmpp.Client, iqc chan xmpp.IQ, recipient string, fingerprint string) (*crypto.KeyRing, error) {
opkr := etree.NewDocument()
opkr.WriteSettings.AttrSingleQuote = true
opkrPs := opkr.CreateElement("pubsub")
@ -561,9 +551,7 @@ func oxRecvPublicKeys(client *xmpp.Client, iqc chan xmpp.IQ, recipient string,
return keyring, nil
}
func oxGetPublicKeyRing(client *xmpp.Client, iqc chan xmpp.IQ,
recipient string,
) (*crypto.KeyRing, error) {
func oxGetPublicKeyRing(client *xmpp.Client, iqc chan xmpp.IQ, recipient string) (*crypto.KeyRing, error) {
publicKeyRing, err := crypto.NewKeyRing(nil)
if errors.Unwrap(err) != nil {
return nil, fmt.Errorf("oxGetPublicKeyRing: failed to create a new keyring: %w", err)
@ -702,9 +690,7 @@ func oxGetPublicKeyRing(client *xmpp.Client, iqc chan xmpp.IQ,
return pubKeyRing, nil
}
func oxEncrypt(client *xmpp.Client, oxPrivKey *crypto.Key,
recipient string, keyRing *crypto.KeyRing, message string,
) (string, error) {
func oxEncrypt(client *xmpp.Client, oxPrivKey *crypto.Key, recipient string, keyRing *crypto.KeyRing, message string) (string, error) {
if message == "" {
return "", nil
}

@ -13,9 +13,7 @@ import (
"github.com/mattn/go-xmpp" // BSD-3-Clause
)
func sendIQ(client *xmpp.Client, iqc chan xmpp.IQ, target string,
iQtype string, content string,
) (xmpp.IQ, error) {
func sendIQ(client *xmpp.Client, iqc chan xmpp.IQ, target string, iQtype string, content string) (xmpp.IQ, error) {
var iq xmpp.IQ
id := getID()
c := make(chan xmpp.IQ)
@ -29,9 +27,7 @@ func sendIQ(client *xmpp.Client, iqc chan xmpp.IQ, target string,
return iq, nil
}
func getIQ(id string, c chan xmpp.IQ,
iqc chan xmpp.IQ,
) {
func getIQ(id string, c chan xmpp.IQ, iqc chan xmpp.IQ) {
for {
iq := <-iqc
if iq.ID == id {

Loading…
Cancel
Save