disconnect
This commit is contained in:
parent
4d7017402d
commit
81906f08f6
|
@ -70,8 +70,6 @@ func (odClient *ODClient) Connect(privateKeyData string, serverAddr string) erro
|
|||
|
||||
log.Println("ODClient: Authenticated")
|
||||
|
||||
log.Println("go")
|
||||
|
||||
log.Println("RequestOpenChanel chat")
|
||||
err = odClient.connection.RequestOpenChannel("im.ricochet.chat", odClient)
|
||||
if err != nil {
|
||||
|
@ -84,6 +82,13 @@ func (odClient *ODClient) Connect(privateKeyData string, serverAddr string) erro
|
|||
return nil
|
||||
}
|
||||
|
||||
func (odClient *ODClient) Disconnect() {
|
||||
log.Println("Break()...")
|
||||
odClient.connection.Break()
|
||||
log.Println("Conn.Close()...")
|
||||
odClient.connection.Conn.Close()
|
||||
}
|
||||
|
||||
/*func (odClient *ODClient) RequestContact() {
|
||||
odClient.connection.Do(func() error {
|
||||
channel := odClient.connection.Channel("im.ricochet.contact.request", channels.Outbound)
|
||||
|
|
|
@ -17,7 +17,7 @@ var (
|
|||
// moddified
|
||||
levelArr = []int{1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6}
|
||||
|
||||
odClient *ODClient.ODClient
|
||||
odClient *ODClient.ODClient = nil
|
||||
)
|
||||
|
||||
func GeneratePrivateKey() (string, error) {
|
||||
|
@ -45,6 +45,12 @@ func ODClientConnect(privateKey string, serverAddr string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func ODClientDisconnect() {
|
||||
log.Println("ODClientDisconnect()")
|
||||
odClient.Disconnect()
|
||||
odClient = nil
|
||||
}
|
||||
|
||||
func GetDeviceName() string {
|
||||
odClient.SendMessage("/name")
|
||||
name := odClient.GetMessage()
|
||||
|
|
Loading…
Reference in New Issue