Skip to content

Commit

Permalink
Save sender email for messagesthat are sent and deleted
Browse files Browse the repository at this point in the history
Signed-off-by: GretaD <gretadoci@gmail.com>
  • Loading branch information
GretaD committed Feb 7, 2020
1 parent a4b3f89 commit 1bc47a4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/components/Composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ import {htmlToText, textToSimpleHtml} from '../util/HtmlHelper'
import Loading from './Loading'
import logger from '../logger'
import TextEditor from './TextEditor'
import {emit} from '@nextcloud/event-bus'
const debouncedSearch = debouncePromise(findRecipient, 500)
Expand Down Expand Up @@ -421,7 +422,10 @@ export default {
.then(this.getMessageData())
.then(data => this.send(data))
.then(() => logger.info('message sent'))
.then(() => (this.state = STATES.FINISHED))
.then(() => {
emit('mail:interaction', {type: 'message-sent', recipient: this.selectedUser.user})
this.state = STATES.FINISHED
})
.catch(error => {
logger.error('could not send message', {error})
if (error && error.toString) {
Expand Down
8 changes: 6 additions & 2 deletions src/components/Envelope.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ export default {
},
methods: {
onToggleFlagged() {
this.$store.dispatch('toggleEnvelopeFlagged', this.data)
emit('mail:interaction', { type: 'message-starred', recipient: this.selectedUser.user})
this.$store.dispatch('toggleEnvelopeFlagged', this.data).then(() => {
emit('mail:interaction', {
type: 'message-starred',
recipient: this.recipient.email,
})
})
},
onToggleSeen() {
this.$store.dispatch('toggleEnvelopeSeen', this.data)
Expand Down
17 changes: 13 additions & 4 deletions src/components/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,13 @@ export default {
})
},
onToggleSeen() {
this.$store.dispatch('toggleEnvelopeSeen', this.envelope)
emit('mail:interaction', { type: 'message-read', recipient: this.selectedUser.user})
},
this.$store.dispatch('toggleEnvelopeSeen', this.envelope).then(() => {
emit('mail:interaction', {
type: 'message-read',
recipient: this.selectedUser.user,
})
})
},
onDelete(e) {
// Don't try to navigate to the deleted message
e.preventDefault()
Expand All @@ -253,7 +257,12 @@ export default {
}
this.$emit('delete', this.envelope)
this.$store.dispatch('deleteMessage', this.envelope)
this.$store.dispatch('deleteMessage', this.envelope).then(() => {
emit('mail:interaction', {
type: 'message-delete',
recipient: this.selectedUser.user,
})
})
if (!next) {
Logger.debug('no next/previous envelope, not navigating')
Expand Down

0 comments on commit 1bc47a4

Please sign in to comment.