image previews #51

Merged
sarah merged 7 commits from ipreview into trunk 2021-12-19 01:21:40 +00:00
Owner
* depends on https://git.openprivacy.ca/cwtch.im/cwtch/pulls/413
erinn added 4 commits 2021-12-17 00:51:08 +00:00
sarah approved these changes 2021-12-17 19:55:28 +00:00
@ -269,0 +281,4 @@
if fm.ShouldAutoDL() {
settings := ReadGlobalSettings()
basepath := settings.DownloadPath
fp, mp := filesharing.GenerateDownloadPath(basepath, fm.Name)

These two paths (for NewMessageFromPeer and NewMessageFromGroup) are very similar any way to combine them?

These two paths (for NewMessageFromPeer and NewMessageFromGroup) are very similar any way to combine them?

pull out and make a function?

pull out and make a function?
@ -283,2 +308,4 @@
conversationID, _ := strconv.Atoi(ev.Event.Data[event.ConversationID])
profile.SetConversationAttribute(conversationID, attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(constants2.Archived)), event.False)
// note careful use of ci.ID versus conversationID

expand comment to explain this is because we download from the contact not the group we received the message on (for now at least).

expand comment to explain this is because we download from the contact not the group we received the message on (for now at least).
erinn marked this conversation as resolved
@ -285,0 +322,4 @@
basepath := settings.DownloadPath
fp, mp := filesharing.GenerateDownloadPath(basepath, fm.Name)
log.Debugf("autodownloading file!")
ev.Event.Data["Auto"] = "true"

use contants.True

use `contants.True`
erinn marked this conversation as resolved
@ -285,0 +324,4 @@
log.Debugf("autodownloading file!")
ev.Event.Data["Auto"] = "true"
mID, _ := strconv.Atoi(ev.Event.Data["Index"])
profile.UpdateMessageAttribute(conversationID, 0, mID, "file-downloaded", "true")

file-downloaded should probably be in constants, use constants.True

file-downloaded should probably be in `constants`, use `constants.True`
erinn marked this conversation as resolved
dan reviewed 2021-12-18 17:57:41 +00:00
@ -282,6 +307,29 @@ func (eh *EventHandler) handleProfileEvent(ev *EventProfileEnvelope) string {
ev.Event.Data["Picture"] = RandomProfileImage(ev.Event.Data[event.RemotePeer])
conversationID, _ := strconv.Atoi(ev.Event.Data[event.ConversationID])
profile.SetConversationAttribute(conversationID, attr.LocalScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(constants2.Archived)), event.False)

not actaully in this PR but @sarah why are we setting this attribute on each message from group?

not actaully in this PR but @sarah why are we setting this attribute on each message from group?
erinn added 2 commits 2021-12-19 01:16:39 +00:00
erinn added 1 commit 2021-12-19 01:20:15 +00:00
continuous-integration/drone/pr Build is pending Details
11bbc3aa78
bump cwtch and fix miscommits
erinn changed title from wip: image previews to image previews 2021-12-19 01:20:42 +00:00
sarah merged commit e4244aeb31 into trunk 2021-12-19 01:21:40 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No Label
No Milestone
No Assignees
3 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/libcwtch-go#51
No description provided.