Format
This commit is contained in:
parent
65f077c645
commit
22e76b6a37
@ -17,10 +17,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"maunium.net/go/mautrix-whatsapp/types"
|
||||
"strings"
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
|
||||
"maunium.net/go/maulogger"
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
"maunium.net/go/mautrix-whatsapp/types"
|
||||
)
|
||||
|
||||
type CommandHandler struct {
|
||||
|
@ -18,11 +18,12 @@ package config
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"text/template"
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
"strings"
|
||||
"strconv"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/Rhymen/go-whatsapp"
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
"maunium.net/go/mautrix-whatsapp/types"
|
||||
)
|
||||
|
||||
@ -86,10 +87,10 @@ func (bc BridgeConfig) FormatUsername(receiver types.MatrixUserID, userID types.
|
||||
|
||||
func (bc BridgeConfig) MarshalYAML() (interface{}, error) {
|
||||
bc.DisplaynameTemplate = bc.FormatDisplayname(whatsapp.Contact{
|
||||
Jid: "{{.Jid}}",
|
||||
Jid: "{{.Jid}}",
|
||||
Notify: "{{.Notify}}",
|
||||
Name: "{{.Name}}",
|
||||
Short: "{{.Short}}",
|
||||
Name: "{{.Name}}",
|
||||
Short: "{{.Short}}",
|
||||
})
|
||||
bc.UsernameTemplate = bc.FormatUsername("{{.Receiver}}", "{{.UserID}}")
|
||||
return bc, nil
|
||||
|
@ -17,9 +17,10 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
"io/ioutil"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
|
@ -17,9 +17,10 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
"regexp"
|
||||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
)
|
||||
|
||||
func (config *Config) NewRegistration() (*appservice.Registration, error) {
|
||||
|
@ -18,6 +18,7 @@ package database
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
log "maunium.net/go/maulogger"
|
||||
)
|
||||
|
@ -17,9 +17,10 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
log "maunium.net/go/maulogger"
|
||||
"maunium.net/go/mautrix-whatsapp/types"
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
type MessageQuery struct {
|
||||
|
@ -17,9 +17,10 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
log "maunium.net/go/maulogger"
|
||||
"maunium.net/go/mautrix-whatsapp/types"
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
type PortalQuery struct {
|
||||
|
@ -17,9 +17,10 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
log "maunium.net/go/maulogger"
|
||||
"maunium.net/go/mautrix-whatsapp/types"
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
type PuppetQuery struct {
|
||||
|
@ -17,10 +17,11 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
log "maunium.net/go/maulogger"
|
||||
"github.com/Rhymen/go-whatsapp"
|
||||
"maunium.net/go/mautrix-whatsapp/types"
|
||||
"database/sql"
|
||||
|
||||
"github.com/Rhymen/go-whatsapp"
|
||||
log "maunium.net/go/maulogger"
|
||||
"maunium.net/go/mautrix-whatsapp/types"
|
||||
)
|
||||
|
||||
type UserQuery struct {
|
||||
@ -46,8 +47,8 @@ func (uq *UserQuery) CreateTable() error {
|
||||
|
||||
func (uq *UserQuery) New() *User {
|
||||
return &User{
|
||||
db: uq.db,
|
||||
log: uq.log,
|
||||
db: uq.db,
|
||||
log: uq.log,
|
||||
}
|
||||
}
|
||||
|
||||
|
7
main.go
7
main.go
@ -19,12 +19,13 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"maunium.net/go/mautrix-whatsapp/config"
|
||||
flag "maunium.net/go/mauflag"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
|
||||
flag "maunium.net/go/mauflag"
|
||||
log "maunium.net/go/maulogger"
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
"maunium.net/go/mautrix-whatsapp/config"
|
||||
"maunium.net/go/mautrix-whatsapp/database"
|
||||
"maunium.net/go/mautrix-whatsapp/types"
|
||||
)
|
||||
|
@ -17,11 +17,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"maunium.net/go/gomatrix"
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"maunium.net/go/gomatrix"
|
||||
"maunium.net/go/mautrix-appservice"
|
||||
)
|
||||
|
||||
type AutosavingStateStore struct {
|
||||
|
@ -17,8 +17,9 @@
|
||||
package whatsappExt
|
||||
|
||||
import (
|
||||
"github.com/Rhymen/go-whatsapp"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/Rhymen/go-whatsapp"
|
||||
)
|
||||
|
||||
type ProtocolProps struct {
|
||||
|
@ -18,6 +18,7 @@ package whatsappExt
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/Rhymen/go-whatsapp"
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user