diff --git a/go/ui/gcd.go b/go/ui/gcd.go
index 39458ab9..8c80e867 100644
--- a/go/ui/gcd.go
+++ b/go/ui/gcd.go
@@ -12,6 +12,7 @@ import (
"github.com/therecipe/qt/qml"
"strconv"
"sync"
+ "time"
"cwtch.im/ui/go/the"
"encoding/base32"
@@ -69,7 +70,7 @@ type GrandCentralDispatcher struct {
_ func(server string) `signal:"startServer,auto"`
_ func(server string) `signal:"stopServer,auto"`
_ func(server string) `signal:"checkServer,auto"`
- _ func(server string, enabled bool) `signal:"autostartServer",auto`
+ _ func(server string, enabled bool) `signal:"autostartServer,auto"`
// contact list stuff
_ func(handle, displayName, image string, badge, status int, authorization string, loading bool, lastMsgTime int) `signal:"AddContact"`
@@ -139,6 +140,11 @@ type GrandCentralDispatcher struct {
_ func(handle string) `signal:"requestServerSettings,auto"`
_ func() `constructor:"init"`
+
+ // legacy overlay model support
+ _ func(onion string, overlay int) `signal:"legacyLoadOverlay,auto"`
+ _ func(handle, from, displayName, message, image string, mID string, fromMe bool, ts int64, ackd bool, error bool) `signal:"AppendMessage"`
+ _ func(handle, from, displayName, message, image string, mID string, fromMe bool, ts int64, ackd bool, error bool) `signal:"PrependMessage"`
}
func (this *GrandCentralDispatcher) init() {
@@ -326,6 +332,70 @@ func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) {
}
updateLastReadTime(contact.Onion)
this.SetToolbarTitle(nick)
+
+ this.legacyLoadOverlay(handle, 4)
+}
+
+func (this *GrandCentralDispatcher) legacyLoadOverlay(handle string, overlay int) {
+ go this.legacyLoadOverlay_helper(handle, overlay)
+}
+
+func (this *GrandCentralDispatcher) legacyLoadOverlay_helper(handle string, overlay int) {
+ if isGroup(handle) {
+ group := the.CwtchApp.GetPeer(this.selectedProfile()).GetGroup(handle)
+ tl := group.GetTimeline()
+
+ for i := len(tl) - 1; i >= 0; i-- {
+ if tl[i].PeerID == the.Peer.GetOnion() {
+ handle = "me"
+ } else {
+ handle = tl[i].PeerID
+ }
+
+ name := GetNick(tl[i].PeerID)
+ image := GetProfilePic(tl[i].PeerID)
+
+ this.PrependMessage(
+ handle,
+ tl[i].PeerID,
+ name,
+ tl[i].Message,
+ image,
+ string(tl[i].Signature),
+ tl[i].PeerID == the.Peer.GetOnion(),
+ tl[i].Timestamp.Unix(),
+ tl[i].Received.Equal(time.Unix(0, 0)) == false, // If the received timestamp is epoch, we have not yet received this message through an active server
+ false,
+ )
+ }
+
+ } else {// !isGroup
+ messages := the.CwtchApp.GetPeer(this.selectedProfile()).GetContact(handle).Timeline.GetMessages()
+ for i := len(messages) - 1; i >= 0; i-- {
+ from := messages[i].PeerID
+ fromMe := messages[i].PeerID == the.Peer.GetOnion()
+ if fromMe {
+ from = "me"
+ }
+
+ displayname := GetNick(messages[i].PeerID)
+ image := GetProfilePic(messages[i].PeerID)
+
+ this.PrependMessage(
+ from,
+ messages[i].PeerID,
+ displayname,
+ messages[i].Message,
+ image,
+ string(messages[i].Signature),
+ fromMe,
+ messages[i].Timestamp.Unix(),
+ messages[i].Acknowledged,
+ messages[i].Error != "",
+ )
+ }
+
+ }
}
func (this *GrandCentralDispatcher) requestSettings() {
diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts
index c27fa42e..2722864c 100644
--- a/i18n/translation_de.ts
+++ b/i18n/translation_de.ts
@@ -105,23 +105,38 @@ Name
BulletinOverlay
-
+ Neue Meldung
-
+ Post a new Bulletin PostNeue Meldung veröffentlichen
-
+ title place holder textTitel...
+
+ ChatOverlay
+
+
+
+ This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right.
+
+
+
+
+
+ Message history is enabled.
+
+
+ContactList
@@ -233,18 +248,18 @@ Name
noch zu erledigen
-
+ ex: "... paste an address here to add a contact ..."
-
+
-
+
@@ -252,7 +267,7 @@ Name
MembershipOverlay
-
+ Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group.Unten steht eine Liste der Benutzer, die Nachrichten an die Gruppe gesendet haben. Möglicherweise enthält diese Benutzerzliste nicht alle, die Zugang zur Gruppe haben.
@@ -267,18 +282,18 @@ Name
Klicken, um DM zu senden
-
+ Could not send this messageNachricht konnte nicht gesendet werden
-
+ bestätigt
-
+ Bestätigung ausstehend
@@ -286,13 +301,13 @@ Name
MessageEditor
-
+ Peer is blocked
-
+ Peer is offline, messages can't be delivered right now
@@ -719,7 +734,7 @@ Name
main
-
+ New Connection
diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm
index eb00a31c..588c4b12 100644
Binary files a/i18n/translation_en.qm and b/i18n/translation_en.qm differ
diff --git a/i18n/translation_en.ts b/i18n/translation_en.ts
index 59a7ed6d..d8c7d1a2 100644
--- a/i18n/translation_en.ts
+++ b/i18n/translation_en.ts
@@ -118,23 +118,41 @@ Name
BulletinOverlay
-
+ New Bulletin
-
+ Post a new Bulletin PostPost new bulletin
-
+ title place holder texttitle...
+
+ ChatOverlay
+
+
+
+ This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right.
+
+ Your history with this peer is ephemeral and will not be saved. If you would like to save history, please go to settings and turn it on.
+
+
+
+
+ Message history is enabled.
+ Message history is enabled.
+
+ContactList
@@ -326,18 +344,18 @@ Right-click to reset.
ListOverlay
-
+ ex: "... paste an address here to add a contact ..."Search List
-
+ Peer is Offline. Applications cannot be used right now.
-
+ Add Item
@@ -345,7 +363,7 @@ Right-click to reset.
MembershipOverlay
-
+ Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group.Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group.
@@ -360,18 +378,18 @@ Right-click to reset.
Click to DM
-
+ Could not send this messageCould not send this message
-
+ Acknowledged
-
+ Pending
@@ -379,13 +397,13 @@ Right-click to reset.
MessageEditor
-
+ Peer is blockedPeer is blocked
-
+ Peer is offline, messages can't be delivered right nowPeer is offline, messages can't be delivered right now
@@ -855,7 +873,7 @@ Right-click to reset.
main
-
+ New ConnectionNew Connection
diff --git a/i18n/translation_fr.ts b/i18n/translation_fr.ts
index 6d65ff5b..9ea4e441 100644
--- a/i18n/translation_fr.ts
+++ b/i18n/translation_fr.ts
@@ -105,23 +105,38 @@ Name
BulletinOverlay
-
+ Nouveau bulletin
-
+ Post a new Bulletin PostEnvoyer un nouveau bulletin
-
+ title place holder texttitre...
+
+ ChatOverlay
+
+
+
+ This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right.
+
+
+
+
+
+ Message history is enabled.
+
+
+ContactList
@@ -233,18 +248,18 @@ Name
A faire...
-
+ ex: "... paste an address here to add a contact ..."
-
+
-
+
@@ -252,7 +267,7 @@ Name
MembershipOverlay
-
+ Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group.Liste des utilisateurs ayant envoyés un ou plusieurs messages au groupe. Cette liste peut ne pas être representatives de l'ensemble des membres du groupe.
@@ -267,18 +282,18 @@ Name
Envoyer un message privé
-
+ Could not send this messageImpossible d'envoyer ce message
-
+ Confirmé
-
+ En attente
@@ -286,13 +301,13 @@ Name
MessageEditor
-
+ Peer is blocked
-
+ Peer is offline, messages can't be delivered right now
@@ -719,7 +734,7 @@ Name
main
-
+ New Connection
diff --git a/i18n/translation_pt.ts b/i18n/translation_pt.ts
index d18c42f1..ed9b6164 100644
--- a/i18n/translation_pt.ts
+++ b/i18n/translation_pt.ts
@@ -105,23 +105,38 @@ Name
BulletinOverlay
-
+ Novo Boletim
-
+ Post a new Bulletin PostPostar novo boletim
-
+ title place holder texttítulo…
+
+ ChatOverlay
+
+
+
+ This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right.
+
+
+
+
+
+ Message history is enabled.
+
+
+ContactList
@@ -233,18 +248,18 @@ Name
Afazer…
-
+ ex: "... paste an address here to add a contact ..."
-
+
-
+
@@ -252,7 +267,7 @@ Name
MembershipOverlay
-
+ Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group.A lista abaixo é de usuários que enviaram mensagens ao grupo. Essa lista pode não refletir todos os usuários que têm acesso ao grupo.
@@ -267,18 +282,18 @@ Name
Clique para DM
-
+ Could not send this messageNão deu para enviar esta mensagem
-
+ Confirmada
-
+ Pendente
@@ -286,13 +301,13 @@ Name
MessageEditor
-
+ Peer is blocked
-
+ Peer is offline, messages can't be delivered right now
@@ -719,7 +734,7 @@ Name
main
-
+ New Connection
diff --git a/qml/main.qml b/qml/main.qml
index 6ef50a17..1c65a699 100644
--- a/qml/main.qml
+++ b/qml/main.qml
@@ -238,7 +238,7 @@ ApplicationWindow {
Layout.fillHeight: true
OverlayPane { // messagePane
anchors.fill: parent
- anchors.topMargin: 10 * gcd.themeScale
+ anchors.topMargin: 10// * gcd.themeScale
}
}
diff --git a/qml/overlays/ChatOverlay.qml b/qml/overlays/ChatOverlay.qml
index e30a0d17..c5c49711 100644
--- a/qml/overlays/ChatOverlay.qml
+++ b/qml/overlays/ChatOverlay.qml
@@ -50,12 +50,45 @@ W.Overlay {
spacing: 6
clip: true
- ScrollBar.vertical: Opaque.ScrollBar {}
+ ScrollBar.vertical: Opaque.ScrollBar {id:scrollbar}
maximumFlickVelocity: 1250
section.delegate: sectionHeading
section.property: "Day"
+ header: Component {
+ Column {
+ width: messagesListView.width
+
+ Label {
+ wrapMode: Text.WordWrap
+ width: messagesListView.width
+ font.pointSize: Theme.textSmallPt
+ font.weight: Font.Bold
+ color: Theme.chatOverlayWarningTextColor
+ horizontalAlignment: Text.AlignHCenter
+ //: This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right.
+ text: true ? qsTr("chat-history-disabled") :
+ //: Message history is enabled.
+ qsTr("chat-history-enabled")
+ }
+
+ Opaque.Icon {
+ anchors.horizontalCenter: parent.horizontalCenter
+ backgroundColor: Theme.backgroundMainColor
+ iconColor: Theme.chatOverlayWarningTextColor
+ source: gcd.assetPath + "core/peer_settings-24px.webp"
+ size: Theme.uiIconSizeM
+ sourceWidth: 72
+ sourceHeight: 72
+ width: Theme.uiIconSizeM
+ height: Theme.uiIconSizeM
+ }
+
+ Opaque.HLine {}
+ }
+ }
+
delegate: W.Message {
handle: PeerID
@@ -72,7 +105,7 @@ W.Overlay {
calendarEvent: PeerID == "calendar"
// listview doesnt do anchors right
// https://stackoverflow.com/questions/31381997/why-does-anchors-fill-does-not-work-in-a-qml-listviews-delegates-subviews-and/31382307
- width: messagesListView.width
+ width: messagesListView.width - scrollbar.width
}
Component {
@@ -83,7 +116,7 @@ W.Overlay {
property string txt: section
color: Theme.backgroundMainColor
width: parent.width
- height: texmet.height + 6 + 12 * gcd.themeScale
+ height: texmet.height + 6 + 12// * gcd.themeScale
anchors.horizontalCenter: parent.horizontalCenter