new message model #347

Merged
dan merged 6 commits from mm into master 2020-10-23 17:30:49 +00:00
Owner
  • depends on cwtch branch cwtch.im/cwtch@specify-events
* depends on cwtch branch cwtch.im/cwtch@specify-events
Member

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/658

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/658
sarah reviewed 2020-10-20 23:04:56 +00:00
go.mod Outdated
@ -4,3 +4,3 @@
require (
cwtch.im/cwtch v0.4.1
cwtch.im/cwtch v0.4.2-0.20201016053957-1933fb703fb0

will need to cut a new release in Cwtch and update this...

will need to cut a new release in Cwtch and update this...
erinn marked this conversation as resolved
main.go Outdated
@ -41,1 +43,4 @@
func main() {
peer.DefaultEventsToHandle = []event.Type{
event.EncryptedGroupMessage,
//event.NewMessageFromPeer,

delete

delete
erinn marked this conversation as resolved
@ -21,0 +21,4 @@
onRowsInserted: {
if (messagesListView.atYEnd) thymer.running = true
//todo: this won't fire for non-active convos

this still a todo?

this still a todo?
Author
Owner

it's a bugfix i preserved. created #348 to track it

it's a bugfix i preserved. created #348 to track it
Author
Owner

bug*

bug*
erinn marked this conversation as resolved
dan reviewed 2020-10-22 19:11:16 +00:00
dan left a comment
Owner
func (this *manager) AboutToAddMessage() {
	this.gcd.TimelineInterface.AddMessage(this.gcd.TimelineInterface.num())
}


func (this *manager) MessageJustAdded() {
	this.gcd.TimelineInterface.RequestEIR()
}

Wow QT/QML just makes this process so seamless -_-;

``` func (this *manager) AboutToAddMessage() { this.gcd.TimelineInterface.AddMessage(this.gcd.TimelineInterface.num()) } func (this *manager) MessageJustAdded() { this.gcd.TimelineInterface.RequestEIR() } ``` Wow QT/QML just makes this process so seamless -_-;
Makefile Outdated
@ -19,3 +19,3 @@
linux_build:
date
qtdeploy -qt_version "5.13.0" build linux 2>&1 | tee qtdeploy.log | pv
qtdeploy -docker -qt_version "5.13.0" build linux 2>&1 | tee qtdeploy.log | pv

delete -docker

delete -docker
@ -1,188 +0,0 @@
cwtch.im/cwtch v0.3.10 h1:akrIwsc1KnLbT3K6ZIFkhmA7kI62L03EWna7Ul1vszU=

did you delete the entire go.sum?

did you delete the entire go.sum?
erinn marked this conversation as resolved
@ -9,3 +9,3 @@
)
// Terrible, to be replaced when proper profile/password management comes in ~ 0.2
// really awesome but nevertheless to be replaced when proper profile/password management comes in ~ 0.2

less accurate, it's now just the default password used in cases of "no encryption selected" for profiles and for the globals.ui file, so its... "safe"ish

less accurate, it's now just the default password used in cases of "no encryption selected" for profiles and for the globals.ui file, so its... "safe"ish
erinn marked this conversation as resolved
go/ui/gcd.go Outdated
@ -120,2 +118,4 @@
_ func(onion string) `signal:"storeHistoryForPeer,auto"`
_ func(onion string) `signal:"deleteHistoryForPeer,auto"`
// chat
_ func(mID string) `slot:"acktest,auto"`

acktest?

acktest?
@ -0,0 +123,4 @@
} else {
contact := the.Peer.GetContact(this.Handle())
if this.Handle() == "" || the.Peer == nil || contact == nil {
modelmsg = model.Message{Message:"oops test hi uhhhhh :/"}

error?

error?
erinn marked this conversation as resolved
@ -0,0 +125,4 @@
if this.Handle() == "" || the.Peer == nil || contact == nil {
modelmsg = model.Message{Message:"oops test hi uhhhhh :/"}
} else if idx >= len(contact.Timeline.Messages) {
log.Errorf("this shouldnt happen")

modelmsg = someDummy template? otherwise the return statement below will segfault?

modelmsg = someDummy template? otherwise the return statement below will segfault?
erinn marked this conversation as resolved
dan reviewed 2020-10-22 19:18:44 +00:00
go/ui/manager.go Outdated
@ -283,0 +295,4 @@
this.gcd.TimelineInterface.RequestEIR()
}
func (this *manager) StoreAndNotify(pere peer.CwtchPeer, onion string, messageTxt string, sent time.Time, profileOnion string) {

pere typo

`pere` typo
Author
Owner

no it's the variable name version of Père aka Father CwtchPeer, preventer of naming conflicts with the peer library

no it's the variable name version of Père aka Father CwtchPeer, preventer of naming conflicts with the peer library
erinn marked this conversation as resolved
go/ui/manager.go Outdated
@ -283,0 +298,4 @@
func (this *manager) StoreAndNotify(pere peer.CwtchPeer, onion string, messageTxt string, sent time.Time, profileOnion string) {
this.gcd.DoIfProfileElse(this.profile, func() {
this.gcd.DoIfConversationElse(onion, func() {
updateLastReadTime(onion)

Re: the comment below, since it's time based, maybe this call to updateLastReadTime() should be called after the message is added since num message new is calculated based on time? and if its updated before the message is added..

Re: the comment below, since it's time based, maybe this call to updateLastReadTime() should be called after the message is added since num message new is calculated based on time? and if its updated before the message is added..
Author
Owner

👍

:+1:
erinn marked this conversation as resolved
go/ui/manager.go Outdated
@ -283,0 +303,4 @@
pere.StoreMessage(onion, messageTxt, sent)
this.gcd.TimelineInterface.RequestEIR()
}, func() {
updateLastReadTime(onion)

updateLastReadTime(onion) - sets the conversation's last read time to now (shouldbe called when the conversation is opened and or open, clearing notifications. we do it at Load messages so all the old ones aren't 1000 notifications in the conversation row bubble. but this is the else? so the conversation isn't open, so we dont want to update the lastReadTime here right?

updateLastReadTime(onion) - sets the conversation's last read time to now (shouldbe called when the conversation is opened and or open, clearing notifications. we do it at Load messages so all the old ones aren't 1000 notifications in the conversation row bubble. but this is the else? so the conversation isn't open, so we dont want to update the lastReadTime here right?
Author
Owner

yep you're right good catch (i was thinking of it as "updateMostRecentMessageArrivalTime" for some reason)

yep you're right good catch (i was thinking of it as "updateMostRecentMessageArrivalTime" for some reason)
erinn marked this conversation as resolved
dan reviewed 2020-10-22 19:27:13 +00:00
main.go Outdated
@ -200,2 +212,4 @@
engine.RootContext().SetContextProperty("gcd", gcd)
gcd.TimelineInterface = ui.NewMessageModel(nil)
gcd.TimelineInterface.SetHandle("66b46c88c1475de1819af2a95d39548d")

?

?
erinn marked this conversation as resolved
@ -56,0 +89,4 @@
Rectangle {
opacity: 1
width: childrenRect.width + 66

Most of the numbers in qml all tediuslyget * gcd.themeScale so the whole ui should scale appropriately

Most of the numbers in qml all tediuslyget * gcd.themeScale so the whole ui should scale appropriately
erinn marked this conversation as resolved
Member

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/677

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/677
Member

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/679

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/679
erinn changed title from WIP: new message model to new message model 2020-10-23 01:18:07 +00:00
Owner

LGTM

LGTM
dan approved these changes 2020-10-23 17:30:32 +00:00
@ -9,3 +9,3 @@
)
// Terrible, to be replaced when proper profile/password management comes in ~ 0.2
// foundation block of the entire app. critical. never change, only obey

thumbs up

thumbs up
dan merged commit 4580d616de into master 2020-10-23 17:30:47 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.