MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / getConnectionStatus

Method getConnectionStatus

server/src/db/community-db.ts:601–616  ·  view source on GitHub ↗
(viewerUserId: string, profileUserId: string)

Source from the content-addressed store, hash-verified

599 }
600
601 async getConnectionStatus(viewerUserId: string, profileUserId: string): Promise<{ status: string; id: string; direction: 'sent' | 'received' } | null> {
602 const result = await query<{ status: string; id: string; requester_user_id: string }>(
603 `SELECT id, status, requester_user_id FROM connections
604 WHERE (requester_user_id = $1 AND recipient_user_id = $2)
605 OR (requester_user_id = $2 AND recipient_user_id = $1)
606 LIMIT 1`,
607 [viewerUserId, profileUserId]
608 );
609 const row = result.rows[0];
610 if (!row) return null;
611 return {
612 status: row.status,
613 id: row.id,
614 direction: row.requester_user_id === viewerUserId ? 'sent' : 'received',
615 };
616 }
617
618 async getConnectionCount(userId: string): Promise<number> {
619 const result = await query<{ count: string }>(

Callers 2

getPersonBySlugMethod · 0.95
createCommunityRoutersFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected