MCPcopy Create free account
hub / github.com/Treeki/BirdBridge / isMentionsTimelineQuery

Function isMentionsTimelineQuery

main.ts:214–236  ·  view source on GitHub ↗
(data: any)

Source from the content-addressed store, hash-verified

212});
213
214function isMentionsTimelineQuery(data: any): boolean {
215 if (data.types && Array.isArray(data.types)) {
216 // for Ivory
217 if ((data.types.length === 1 && data.types[0] === 'mention') ||
218 (data.types.length === 2 && data.types[0] === 'mention' && data.types[1] === 'mention'))
219 return true;
220 } else if (data.exclude_types && Array.isArray(data.exclude_types)) {
221 // for Pinafore
222 const check = [
223 'follow', 'favourite', 'reblog', 'poll',
224 'admin.sign_up', 'update', 'follow_request', 'admin.report'
225 ];
226 if (data.exclude_types.length === check.length) {
227 for (let i = 0; i < check.length; i++) {
228 if (check[i] !== data.exclude_types[i])
229 return false;
230 }
231 return true;
232 }
233 }
234
235 return false;
236}
237
238app.get('/api/v1/notifications', async (req, res) => {
239 const params: Record<string, any> = buildParams(true);

Callers 1

main.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected