| 672 | this.channel.lastmessageid = undefined; |
| 673 | } |
| 674 | } |
| 675 | if (this.channel.lastreadmessageid === this.id) { |
| 676 | if (prev) { |
| 677 | this.channel.lastreadmessageid = prev; |
| 678 | } else { |
| 679 | this.channel.lastreadmessageid = undefined; |
| 680 | } |
| 681 | } |
| 682 | console.log("deleted done"); |
| 683 | } |
| 684 | pollUpdate(update: pollUpdateJson) { |
| 685 | if (!this.poll) return; |
| 686 | if (!this.poll.results) this.poll.results = {is_finalized: false, answer_counts: []}; |
| 687 | let ans = this.poll.results.answer_counts.find((_) => _.id === update.d.answer_id); |
| 688 | if (!ans) { |
| 689 | ans = {id: update.d.answer_id, count: 0, me_voted: false}; |
| 690 | this.poll.results.answer_counts.push(ans); |
| 691 | } |
| 692 | if (update.t === "MESSAGE_POLL_VOTE_ADD") { |