forked from cwtch.im/cwtch
fmt
This commit is contained in:
parent
0cfd672c83
commit
e3dfdf35e0
|
@ -1,14 +1,14 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"log"
|
|
||||||
"time"
|
|
||||||
"cwtch.im/cwtch/peer"
|
"cwtch.im/cwtch/peer"
|
||||||
|
"fmt"
|
||||||
"github.com/marcusolsson/tui-go"
|
"github.com/marcusolsson/tui-go"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -91,7 +91,7 @@ func (cp *CwtchPeer) ImportGroup(exportedInvite string) (groupID string, err err
|
||||||
if err == nil {
|
if err == nil {
|
||||||
edpk := ed25519.PublicKey(pk)
|
edpk := ed25519.PublicKey(pk)
|
||||||
onion := exportedInvite[5:21]
|
onion := exportedInvite[5:21]
|
||||||
cp.Profile.AddContact(onion, &model.PublicProfile{Name:"", Ed25519PublicKey: edpk, Trusted: true, Blocked: false, Onion: onion})
|
cp.Profile.AddContact(onion, &model.PublicProfile{Name: "", Ed25519PublicKey: edpk, Trusted: true, Blocked: false, Onion: onion})
|
||||||
cp.Profile.ProcessInvite(cpp.GetGroupChatInvite(), onion)
|
cp.Profile.ProcessInvite(cpp.GetGroupChatInvite(), onion)
|
||||||
return cpp.GroupChatInvite.GetGroupName(), nil
|
return cpp.GroupChatInvite.GetGroupName(), nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,4 +31,4 @@ func main() {
|
||||||
|
|
||||||
// TODO load params from .cwtch/server.conf or command line flag
|
// TODO load params from .cwtch/server.conf or command line flag
|
||||||
server.Run(serverConfig)
|
server.Run(serverConfig)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
|
|
||||||
// Server encapsulates a complete, compliant Cwtch server.
|
// Server encapsulates a complete, compliant Cwtch server.
|
||||||
type Server struct {
|
type Server struct {
|
||||||
app *application.RicochetApplication
|
app *application.RicochetApplication
|
||||||
config *Config
|
config *Config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sync"
|
"crypto/rsa"
|
||||||
|
"encoding/json"
|
||||||
"github.com/s-rah/go-ricochet/utils"
|
"github.com/s-rah/go-ricochet/utils"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"encoding/json"
|
"sync"
|
||||||
"crypto/rsa"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reporting is a struct for storing a the config a server needs to be a peer, and connect to a group to report
|
// Reporting is a struct for storing a the config a server needs to be a peer, and connect to a group to report
|
||||||
type Reporting struct {
|
type Reporting struct {
|
||||||
PeerPrivateKey string `json:"privateKey"`
|
PeerPrivateKey string `json:"privateKey"`
|
||||||
ReportingGroupID string `json:"reportingGroupId"`
|
ReportingGroupID string `json:"reportingGroupId"`
|
||||||
ReportingServerAddr string `json:"reportingServerAddr"`
|
ReportingServerAddr string `json:"reportingServerAddr"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ func TestCwtchPeerIntegration(t *testing.T) {
|
||||||
serverAddr, _ = utils.GetOnionAddress(serverKey)
|
serverAddr, _ = utils.GetOnionAddress(serverKey)
|
||||||
server = new(cwtchserver.Server)
|
server = new(cwtchserver.Server)
|
||||||
fmt.Println("Starting cwtch server...")
|
fmt.Println("Starting cwtch server...")
|
||||||
config := cwtchserver.Config{ PrivateKeyBytes: utils.PrivateKeyToString(serverKey), MaxBufferLines: 100, ServerReporting: cwtchserver.Reporting{ } }
|
config := cwtchserver.Config{PrivateKeyBytes: utils.PrivateKeyToString(serverKey), MaxBufferLines: 100, ServerReporting: cwtchserver.Reporting{}}
|
||||||
go server.Run(&config)
|
go server.Run(&config)
|
||||||
|
|
||||||
// let tor get established
|
// let tor get established
|
||||||
|
|
Loading…
Reference in New Issue