You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Remove now-unused makePollContent from its old location (#2078)
This commit is contained in:
@@ -66,25 +66,3 @@ export interface IPollEndContent extends IContent {
|
|||||||
"rel_type": string;
|
"rel_type": string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function makePollContent(
|
|
||||||
question: string,
|
|
||||||
answers: string[],
|
|
||||||
kind: string,
|
|
||||||
): IPollContent {
|
|
||||||
question = question.trim();
|
|
||||||
answers = answers.map(a => a.trim()).filter(a => !!a);
|
|
||||||
return {
|
|
||||||
[TEXT_NODE_TYPE.name]:
|
|
||||||
`${question}\n${answers.map((a, i) => `${i + 1}. ${a}`).join('\n')}`,
|
|
||||||
[POLL_START_EVENT_TYPE.name]: {
|
|
||||||
kind: kind,
|
|
||||||
question: {
|
|
||||||
[TEXT_NODE_TYPE.name]: question,
|
|
||||||
},
|
|
||||||
answers: answers.map(
|
|
||||||
(a, i) => ({ id: `${i}-${a}`, [TEXT_NODE_TYPE.name]: a }),
|
|
||||||
),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user