forked from cwtch.im/cwtch
Merge branch 'windows' of dan/cwtch into master
This commit is contained in:
commit
b959bfa3d9
|
@ -6,7 +6,6 @@ import (
|
|||
"cwtch.im/cwtch/storage"
|
||||
"fmt"
|
||||
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
||||
|
||||
"path"
|
||||
)
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// +build windows
|
||||
|
||||
package bridge
|
||||
|
||||
import (
|
||||
"cwtch.im/cwtch/event"
|
||||
"log"
|
||||
)
|
||||
|
||||
func NewPipeBridgeClient(inFilename, outFilename string) event.IPCBridge {
|
||||
log.Fatal("Not supported on windows")
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPipeBridgeService returns a pipe backed IPCBridge for a service
|
||||
func NewPipeBridgeService(inFilename, outFilename string) event.IPCBridge {
|
||||
log.Fatal("Not supported on windows")
|
||||
return nil
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
// +build !windows
|
||||
|
||||
package bridge
|
||||
|
||||
import (
|
||||
|
@ -5,12 +7,12 @@ import (
|
|||
"encoding/base64"
|
||||
"encoding/binary"
|
||||
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
||||
"syscall"
|
||||
|
||||
"cwtch.im/cwtch/event"
|
||||
"encoding/json"
|
||||
"os"
|
||||
"sync"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
/* pipeBridge creates a pair of named pipes
|
||||
|
|
|
@ -189,11 +189,11 @@ func (cp *cwtchPeer) GetProfile() *model.Profile {
|
|||
}
|
||||
|
||||
func (cp *cwtchPeer) GetPeerState(onion string) connections.ConnectionState {
|
||||
return connections.ConnectionStateType[cp.Profile.Contacts[onion].State]
|
||||
return connections.ConnectionStateToType[cp.Profile.Contacts[onion].State]
|
||||
}
|
||||
|
||||
func (cp *cwtchPeer) GetGroupState(groupid string) connections.ConnectionState {
|
||||
return connections.ConnectionStateType[cp.Profile.Groups[groupid].State]
|
||||
return connections.ConnectionStateToType[cp.Profile.Groups[groupid].State]
|
||||
}
|
||||
|
||||
// PeerWithOnion is the entry point for cwtchPeer relationships
|
||||
|
|
|
@ -23,7 +23,7 @@ var (
|
|||
// ConnectionStateName allows conversion of states to their string representations
|
||||
ConnectionStateName = []string{"Disconnected", "Connecting", "Connected", "Authenticated", "Synced", "Failed", "Killed"}
|
||||
|
||||
// ConnectionStateType allows conversion of strings to their state type
|
||||
ConnectionStateType = map[string]ConnectionState{"Disconnected": DISCONNECTED, "Connecting": CONNECTING,
|
||||
// ConnectionStateToType allows conversion of strings to their state type
|
||||
ConnectionStateToType = map[string]ConnectionState{"Disconnected": DISCONNECTED, "Connecting": CONNECTING,
|
||||
"Connected": CONNECTED, "Authenticated": AUTHENTICATED, "Synced": SYNCED, "Failed": FAILED, "Killed": KILLED}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue