MCPcopy Create free account
hub / github.com/MathMan05/Fermi / pollUpdate

Method pollUpdate

src/webpage/message.ts:674–689  ·  view source on GitHub ↗
(update: pollUpdateJson)

Source from the content-addressed store, hash-verified

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") {

Callers 1

handleEventMethod · 0.80

Calls 1

findMethod · 0.80

Tested by

no test coverage detected