forked from cwtch.im/cwtch
1
0
Fork 0
This commit is contained in:
Sarah Jamie Lewis 2018-05-02 23:01:15 -07:00
parent c2d349a817
commit 979ad542f7
4 changed files with 25 additions and 32 deletions

View File

@ -1,15 +1,13 @@
package main
import (
"fmt"
app2 "git.mascherari.press/cwtch/app"
"strings"
"github.com/c-bata/go-prompt"
"strings"
)
var app app2.Application
var suggestions = []prompt.Suggest{
@ -99,7 +97,6 @@ func completer(d prompt.Document) []prompt.Suggest {
return s
}
func main() {
cwtch :=
@ -151,13 +148,11 @@ func main() {
}
prmpt := fmt.Sprintf("cwtch [%v]> ", profile)
text := prompt.Input(prmpt, completer, prompt.OptionSuggestionBGColor(prompt.Purple),
prompt.OptionDescriptionBGColor(prompt.White),
prompt.OptionHistory(history))
commands := strings.Split(text[0:len(text)], " ")
commands := strings.Split(text[0:], " ")
history = append(history, text)
switch commands[0] {
case "quit":

View File

@ -23,7 +23,6 @@ func NewConnectionsManager() *Manager {
func (m *Manager) ManagePeerConnection(host string, profile *model.Profile) {
m.lock.Lock()
_, exists := m.peerConnections[host]
if !exists {
ppc := NewPeerPeerConnection(host, profile)
@ -57,7 +56,6 @@ func (m *Manager) GetPeers() map[string]ConnectionState {
return rm
}
func (m *Manager) GetServers() map[string]ConnectionState {
rm := make(map[string]ConnectionState)
m.lock.Lock()