forked from cwtch.im/ui
stop saving anything
This commit is contained in:
parent
2e908a7560
commit
e19711e599
|
@ -1,6 +1,7 @@
|
||||||
package characters
|
package characters
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"cwtch.im/cwtch/event"
|
||||||
"cwtch.im/ui/go/cwutil"
|
"cwtch.im/ui/go/cwutil"
|
||||||
"cwtch.im/ui/go/gobjects"
|
"cwtch.im/ui/go/gobjects"
|
||||||
"cwtch.im/ui/go/the"
|
"cwtch.im/ui/go/the"
|
||||||
|
@ -26,7 +27,7 @@ func PresencePoller(getContact func(string) *gobjects.Contact, addContact func(c
|
||||||
c.Trusted,
|
c.Trusted,
|
||||||
})
|
})
|
||||||
c.SetAttribute("name", c.Name)
|
c.SetAttribute("name", c.Name)
|
||||||
the.CwtchApp.SaveProfile(the.Peer)
|
the.CwtchApp.EventBus().Publish(event.NewEvent(event.RequestProfileSave, map[event.Field]string{}))
|
||||||
}
|
}
|
||||||
|
|
||||||
cxnState, found := the.Peer.GetPeers()[contacts[i]]
|
cxnState, found := the.Peer.GetPeers()[contacts[i]]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package gothings
|
package gothings
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"cwtch.im/cwtch/event"
|
||||||
"cwtch.im/ui/go/constants"
|
"cwtch.im/ui/go/constants"
|
||||||
"cwtch.im/ui/go/cwutil"
|
"cwtch.im/ui/go/cwutil"
|
||||||
|
|
||||||
|
@ -68,7 +69,7 @@ func (this *GrandCentralDispatcher) sendMessage(message string, mID uint) {
|
||||||
if len(this.CurrentOpenConversation()) == 32 { // SEND TO GROUP
|
if len(this.CurrentOpenConversation()) == 32 { // SEND TO GROUP
|
||||||
if !the.Peer.GetGroup(this.CurrentOpenConversation()).Accepted {
|
if !the.Peer.GetGroup(this.CurrentOpenConversation()).Accepted {
|
||||||
the.Peer.GetGroup(this.CurrentOpenConversation()).Accepted = true
|
the.Peer.GetGroup(this.CurrentOpenConversation()).Accepted = true
|
||||||
the.CwtchApp.SaveProfile(the.Peer)
|
the.CwtchApp.EventBus().Publish(event.NewEvent(event.RequestProfileSave, map[event.Field]string{}))
|
||||||
c := this.UIState.GetContact(this.CurrentOpenConversation())
|
c := this.UIState.GetContact(this.CurrentOpenConversation())
|
||||||
c.Trusted = true
|
c.Trusted = true
|
||||||
this.UIState.UpdateContact(c.Handle)
|
this.UIState.UpdateContact(c.Handle)
|
||||||
|
@ -121,7 +122,7 @@ func (this *GrandCentralDispatcher) loadMessagesPane(handle string) {
|
||||||
}
|
}
|
||||||
var name string
|
var name string
|
||||||
var exists bool
|
var exists bool
|
||||||
name, exists = the.Peer.GetProfile().GetCustomAttribute(tl[i].PeerID + "_name")
|
name, exists = the.Peer.GetProfile().GetAttribute(tl[i].PeerID + "_name")
|
||||||
if !exists || name == "" {
|
if !exists || name == "" {
|
||||||
name = tl[i].PeerID[:16] + "..."
|
name = tl[i].PeerID[:16] + "..."
|
||||||
}
|
}
|
||||||
|
@ -210,7 +211,7 @@ func (this *GrandCentralDispatcher) importString(str string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
the.Peer.JoinServer(group.GroupServer)
|
the.Peer.JoinServer(group.GroupServer)
|
||||||
the.CwtchApp.SaveProfile(the.Peer)
|
the.CwtchApp.EventBus().Publish(event.NewEvent(event.RequestProfileSave, map[event.Field]string{}))
|
||||||
this.UIState.AddContact(&gobjects.Contact{
|
this.UIState.AddContact(&gobjects.Contact{
|
||||||
groupID,
|
groupID,
|
||||||
groupID[:12],
|
groupID[:12],
|
||||||
|
@ -258,13 +259,13 @@ func (this *GrandCentralDispatcher) importString(str string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, exists := the.Peer.GetProfile().GetCustomAttribute(name + "_onion")
|
_, exists := the.Peer.GetProfile().GetAttribute(name + "_onion")
|
||||||
if exists {
|
if exists {
|
||||||
this.InvokePopup("can't re-use names :(")
|
this.InvokePopup("can't re-use names :(")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, exists = the.Peer.GetProfile().GetCustomAttribute(onion + "_name")
|
_, exists = the.Peer.GetProfile().GetAttribute(onion + "_name")
|
||||||
if exists {
|
if exists {
|
||||||
this.InvokePopup("already have this contact")
|
this.InvokePopup("already have this contact")
|
||||||
return //TODO: bring them to the duplicate
|
return //TODO: bring them to the duplicate
|
||||||
|
@ -284,7 +285,7 @@ func (this *GrandCentralDispatcher) popup(str string) {
|
||||||
|
|
||||||
func (this *GrandCentralDispatcher) updateNick(nick string) {
|
func (this *GrandCentralDispatcher) updateNick(nick string) {
|
||||||
the.Peer.GetProfile().Name = nick
|
the.Peer.GetProfile().Name = nick
|
||||||
the.CwtchApp.SaveProfile(the.Peer)
|
the.CwtchApp.EventBus().Publish(event.NewEvent(event.RequestProfileSave, map[event.Field]string{}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *GrandCentralDispatcher) createGroup(server, groupName string) {
|
func (this *GrandCentralDispatcher) createGroup(server, groupName string) {
|
||||||
|
@ -304,7 +305,7 @@ func (this *GrandCentralDispatcher) createGroup(server, groupName string) {
|
||||||
|
|
||||||
group := the.Peer.GetGroup(groupID)
|
group := the.Peer.GetGroup(groupID)
|
||||||
group.SetAttribute("nick", groupName)
|
group.SetAttribute("nick", groupName)
|
||||||
the.CwtchApp.SaveProfile(the.Peer)
|
the.CwtchApp.EventBus().Publish(event.NewEvent(event.RequestProfileSave, map[event.Field]string{}))
|
||||||
|
|
||||||
the.Peer.JoinServer(server)
|
the.Peer.JoinServer(server)
|
||||||
group.NewMessage = make(chan model.Message)
|
group.NewMessage = make(chan model.Message)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package gothings
|
package gothings
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"cwtch.im/cwtch/event"
|
||||||
"cwtch.im/cwtch/model"
|
"cwtch.im/cwtch/model"
|
||||||
"cwtch.im/ui/go/constants"
|
"cwtch.im/ui/go/constants"
|
||||||
"cwtch.im/ui/go/gobjects"
|
"cwtch.im/ui/go/gobjects"
|
||||||
|
@ -45,7 +46,7 @@ func (this *InterfaceState) AddContact(c *gobjects.Contact) {
|
||||||
if c.Trusted {
|
if c.Trusted {
|
||||||
the.Peer.GetProfile().TrustPeer(c.Handle)
|
the.Peer.GetProfile().TrustPeer(c.Handle)
|
||||||
}
|
}
|
||||||
the.CwtchApp.SaveProfile(the.Peer)
|
the.CwtchApp.EventBus().Publish(event.NewEvent(event.RequestProfileSave, map[event.Field]string{}))
|
||||||
go the.Peer.PeerWithOnion(c.Handle)
|
go the.Peer.PeerWithOnion(c.Handle)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@ func (this *InterfaceState) AddContact(c *gobjects.Contact) {
|
||||||
this.parentGcd.AddContact(c.Handle, c.DisplayName, c.Image, c.Server, c.Badge, c.Status, c.Trusted)
|
this.parentGcd.AddContact(c.Handle, c.DisplayName, c.Image, c.Server, c.Badge, c.Status, c.Trusted)
|
||||||
}
|
}
|
||||||
|
|
||||||
the.CwtchApp.SaveProfile(the.Peer)
|
the.CwtchApp.EventBus().Publish(event.NewEvent(event.RequestProfileSave, map[event.Field]string{}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *InterfaceState) GetContact(handle string) *gobjects.Contact {
|
func (this *InterfaceState) GetContact(handle string) *gobjects.Contact {
|
||||||
|
@ -98,7 +99,7 @@ func (this *InterfaceState) AddMessage(m *gobjects.Message) {
|
||||||
c.Badge++
|
c.Badge++
|
||||||
this.UpdateContact(c.Handle)
|
this.UpdateContact(c.Handle)
|
||||||
}
|
}
|
||||||
the.CwtchApp.SaveProfile(the.Peer)
|
the.CwtchApp.EventBus().Publish(event.NewEvent(event.RequestProfileSave, map[event.Field]string{}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *InterfaceState) GetMessages(handle string) []*gobjects.Message {
|
func (this *InterfaceState) GetMessages(handle string) []*gobjects.Message {
|
||||||
|
|
3
main.go
3
main.go
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
libapp "cwtch.im/cwtch/app"
|
libapp "cwtch.im/cwtch/app"
|
||||||
|
"cwtch.im/cwtch/event"
|
||||||
"cwtch.im/cwtch/model"
|
"cwtch.im/cwtch/model"
|
||||||
"cwtch.im/ui/go/characters"
|
"cwtch.im/ui/go/characters"
|
||||||
"cwtch.im/ui/go/cwutil"
|
"cwtch.im/ui/go/cwutil"
|
||||||
|
@ -126,7 +127,7 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher) {
|
||||||
log.Errorf("couldn't create one. is your cwtch folder writable?")
|
log.Errorf("couldn't create one. is your cwtch folder writable?")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
the.CwtchApp.SaveProfile(the.Peer)
|
the.CwtchApp.EventBus().Publish(event.NewEvent(event.RequestProfileSave, map[event.Field]string{}))
|
||||||
} else {
|
} else {
|
||||||
the.Peer = the.CwtchApp.PrimaryIdentity()
|
the.Peer = the.CwtchApp.PrimaryIdentity()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue