Clean&combed code
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
package bwhatsapp
|
package bwhatsapp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"mime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"mime"
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/42wim/matterbridge/bridge/config"
|
"github.com/42wim/matterbridge/bridge/config"
|
||||||
"github.com/42wim/matterbridge/bridge/helper"
|
"github.com/42wim/matterbridge/bridge/helper"
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package bwhatsapp
|
package bwhatsapp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"mime"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"bytes"
|
|
||||||
"mime"
|
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
"github.com/42wim/matterbridge/bridge"
|
"github.com/42wim/matterbridge/bridge"
|
||||||
"github.com/42wim/matterbridge/bridge/config"
|
"github.com/42wim/matterbridge/bridge/config"
|
||||||
@@ -303,7 +303,8 @@ func (b *Bwhatsapp) Send(msg config.Message) (string, error) {
|
|||||||
err := b.conn.Send(message)
|
err := b.conn.Send(message)
|
||||||
|
|
||||||
return message.Info.Id, err
|
return message.Info.Id, err
|
||||||
} else {
|
}
|
||||||
|
|
||||||
// Post document message
|
// Post document message
|
||||||
message := whatsapp.DocumentMessage{
|
message := whatsapp.DocumentMessage{
|
||||||
Info: whatsapp.MessageInfo{
|
Info: whatsapp.MessageInfo{
|
||||||
@@ -329,7 +330,7 @@ func (b *Bwhatsapp) Send(msg config.Message) (string, error) {
|
|||||||
|
|
||||||
return message.Info.Id, err
|
return message.Info.Id, err
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Post text message
|
// Post text message
|
||||||
message := whatsapp.TextMessage{
|
message := whatsapp.TextMessage{
|
||||||
Info: whatsapp.MessageInfo{
|
Info: whatsapp.MessageInfo{
|
||||||
@@ -352,7 +353,6 @@ func (b *Bwhatsapp) Send(msg config.Message) (string, error) {
|
|||||||
|
|
||||||
return message.Info.Id, err
|
return message.Info.Id, err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// TODO do we want that? to allow login with QR code from a bridged channel? https://github.com/tulir/mautrix-whatsapp/blob/513eb18e2d59bada0dd515ee1abaaf38a3bfe3d5/commands.go#L76
|
// TODO do we want that? to allow login with QR code from a bridged channel? https://github.com/tulir/mautrix-whatsapp/blob/513eb18e2d59bada0dd515ee1abaaf38a3bfe3d5/commands.go#L76
|
||||||
//func (b *Bwhatsapp) Command(cmd string) string {
|
//func (b *Bwhatsapp) Command(cmd string) string {
|
||||||
|
|||||||
Reference in New Issue
Block a user