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 6, 2020
1 parent a4b3f89 commit 2dd2e18
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 6 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,11 @@ 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
2 changes: 1 addition & 1 deletion src/components/Envelope.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default {
methods: {
onToggleFlagged() {
this.$store.dispatch('toggleEnvelopeFlagged', this.data)
emit('mail:interaction', { type: 'message-starred', recipient: this.selectedUser.user})
emit('mail:interaction', {type: 'message-starred', recipient: this.selectedUser.user})
},
onToggleSeen() {
this.$store.dispatch('toggleEnvelopeSeen', this.data)
Expand Down
5 changes: 3 additions & 2 deletions src/components/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ export default {
},
onToggleSeen() {
this.$store.dispatch('toggleEnvelopeSeen', this.envelope)
emit('mail:interaction', { type: 'message-read', recipient: this.selectedUser.user})
},
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 @@ -254,6 +254,7 @@ export default {
this.$emit('delete', this.envelope)
this.$store.dispatch('deleteMessage', this.envelope)
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 2dd2e18

Please sign in to comment.