forked from cwtch.im/ui
Merge branch 'textfix' of cwtch.im/ui into master
This commit is contained in:
commit
c18de8f4c9
|
@ -27,7 +27,10 @@ func andHisBlackAndWhiteCat(incomingMessages chan gobjects.Letter) {
|
|||
m := <-incomingMessages
|
||||
the.Peer.PeerWithOnion(m.To)
|
||||
log.Debugf("sending message!")
|
||||
the.AcknowledgementIDs[m.To] = append(the.AcknowledgementIDs[m.To], m.MID)
|
||||
ackID := new(the.AckId)
|
||||
ackID.ID = m.MID
|
||||
ackID.Ack = false
|
||||
the.AcknowledgementIDs[m.To] = append(the.AcknowledgementIDs[m.To], ackID)
|
||||
the.Peer.SendMessageToPeer(m.To, m.Message)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,6 +187,11 @@ func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) {
|
|||
messages[i].FromMe,
|
||||
messages[i].Timestamp.Format(constants.TIME_FORMAT),
|
||||
)
|
||||
for _,id := range the.AcknowledgementIDs[messages[i].Handle] {
|
||||
if int(id.ID) == messages[i].MessageID && id.Ack{
|
||||
this.Acknowledged(id.ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,8 @@ func (this *InterfaceState) AddMessage(m *gobjects.Message) {
|
|||
// If an ack, swallow the message and ack from the list.
|
||||
acklist := the.AcknowledgementIDs[m.From]
|
||||
for _,ack := range acklist {
|
||||
this.parentGcd.Acknowledged(ack)
|
||||
ack.Ack = true
|
||||
this.parentGcd.Acknowledged(ack.ID)
|
||||
}
|
||||
} else {
|
||||
this.messages[m.Handle] = append(this.messages[m.Handle], m)
|
||||
|
|
|
@ -8,4 +8,10 @@ import (
|
|||
var CwtchApp app.Application
|
||||
var Peer libPeer.CwtchPeer
|
||||
var CwtchDir string
|
||||
var AcknowledgementIDs map[string][]uint
|
||||
|
||||
type AckId struct {
|
||||
ID uint
|
||||
Ack bool
|
||||
}
|
||||
|
||||
var AcknowledgementIDs map[string][]*AckId
|
||||
|
|
2
main.go
2
main.go
|
@ -33,7 +33,7 @@ func main() {
|
|||
// our globals
|
||||
gcd := gothings.NewGrandCentralDispatcher(nil)
|
||||
gcd.UIState = gothings.NewUIState(gcd)
|
||||
the.AcknowledgementIDs = make(map[string][]uint)
|
||||
the.AcknowledgementIDs = make(map[string][]*the.AckId)
|
||||
gcd.OutgoingMessages = make(chan gobjects.Letter, 1000)
|
||||
|
||||
//TODO: put theme stuff somewhere better
|
||||
|
|
Loading…
Reference in New Issue