This commit is contained in:
Tulir Asokan 2018-08-26 22:53:13 +03:00
parent 65f077c645
commit 22e76b6a37
14 changed files with 40 additions and 27 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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 {

View file

@ -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) {

View file

@ -18,6 +18,7 @@ package database
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
log "maunium.net/go/maulogger"
)

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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,
}
}

View file

@ -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"
)

View file

@ -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 {
@ -70,4 +71,4 @@ func (store *AutosavingStateStore) SetMembership(roomID, userID, membership stri
func (store *AutosavingStateStore) SetPowerLevels(roomID string, levels *gomatrix.PowerLevels) {
store.BasicStateStore.SetPowerLevels(roomID, levels)
store.Save()
}
}

View file

@ -29,4 +29,4 @@ type MatrixUserID = string
type MatrixRoomID = string
// MatrixEventID is the internal ID of a Matrix event.
type MatrixEventID = string
type MatrixEventID = string

View file

@ -17,8 +17,9 @@
package whatsappExt
import (
"github.com/Rhymen/go-whatsapp"
"encoding/json"
"github.com/Rhymen/go-whatsapp"
)
type ProtocolProps struct {

View file

@ -18,6 +18,7 @@ package whatsappExt
import (
"encoding/json"
"github.com/Rhymen/go-whatsapp"
)