diff --git a/frontend/Components/NoteCard/index.tsx b/frontend/Components/NoteCard/index.tsx index 7839661..3ea3a17 100644 --- a/frontend/Components/NoteCard/index.tsx +++ b/frontend/Components/NoteCard/index.tsx @@ -82,7 +82,7 @@ export const NoteCard: React.FC = ({ kinds: [EventKind.meta], authors: [...rootReplies.map((reply) => reply.pubkey), note.pubkey], } - relayPool?.subscribe('main-channel', message) + relayPool?.subscribe('notecard', message) } }) } diff --git a/frontend/Pages/ContactsPage/index.tsx b/frontend/Pages/ContactsPage/index.tsx index f2c2634..f8950ad 100644 --- a/frontend/Pages/ContactsPage/index.tsx +++ b/frontend/Pages/ContactsPage/index.tsx @@ -56,7 +56,7 @@ export const ContactsPage: React.FC = () => { setUsers(results) const missingDataUsers = results.filter((user) => !user.picture).map((user) => user.id) if (missingDataUsers.length > 0) { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('contacts-meta', { kinds: [EventKind.meta], authors: missingDataUsers, }) @@ -70,12 +70,12 @@ export const ContactsPage: React.FC = () => { relayPool?.unsubscribeAll() if (publicKey) { if (selectedTab === 0) { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('contacts-following', { kinds: [EventKind.petNames], authors: [publicKey], }) } else if (selectedTab === 1) { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('contacts-followers', { kinds: [EventKind.petNames], '#p': [publicKey], }) diff --git a/frontend/Pages/ConversationPage/index.tsx b/frontend/Pages/ConversationPage/index.tsx index ee84808..daf1407 100644 --- a/frontend/Pages/ConversationPage/index.tsx +++ b/frontend/Pages/ConversationPage/index.tsx @@ -73,12 +73,12 @@ export const ConversationPage: React.FC = () => { const subscribeDirectMessages: () => void = async () => { relayPool?.unsubscribeAll() if (publicKey && otherPubKey) { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('conversation-other', { kinds: [EventKind.directMessage], authors: [publicKey], '#p': [otherPubKey], }) - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('conversation-user', { kinds: [EventKind.directMessage], authors: [otherPubKey], '#p': [publicKey], diff --git a/frontend/Pages/DirectMessagesPage/index.tsx b/frontend/Pages/DirectMessagesPage/index.tsx index c25f761..48ebb3d 100644 --- a/frontend/Pages/DirectMessagesPage/index.tsx +++ b/frontend/Pages/DirectMessagesPage/index.tsx @@ -55,7 +55,7 @@ export const DirectMessagesPage: React.FC = () => { if (results && results.length > 0) { settDirectMessages(results) const otherUsers = results.map((message) => getOtherPubKey(message, publicKey)) - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('directmessages-meta', { kinds: [EventKind.meta], authors: otherUsers, }) @@ -69,11 +69,11 @@ export const DirectMessagesPage: React.FC = () => { const subscribeDirectMessages: () => void = async () => { relayPool?.unsubscribeAll() if (publicKey) { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('directmessages-user', { kinds: [EventKind.directMessage], authors: [publicKey], }) - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('directmessages-others', { kinds: [EventKind.directMessage], '#p': [publicKey], }) diff --git a/frontend/Pages/HomePage/index.tsx b/frontend/Pages/HomePage/index.tsx index bdc98ae..63d1047 100644 --- a/frontend/Pages/HomePage/index.tsx +++ b/frontend/Pages/HomePage/index.tsx @@ -33,7 +33,7 @@ export const HomePage: React.FC = () => { const calculateInitialNotes: () => Promise = async () => { if (database && publicKey) { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('homepage-contacts', { kinds: [EventKind.petNames], authors: [publicKey], }) @@ -60,7 +60,7 @@ export const HomePage: React.FC = () => { message.limit = pageSize + initialPageSize } - relayPool?.subscribe('main-channel', message) + relayPool?.subscribe('homepage-main', message) } const loadNotes: () => void = () => { @@ -68,11 +68,11 @@ export const HomePage: React.FC = () => { getMainNotes(database, publicKey, pageSize).then((notes) => { setNotes(notes) setRefreshing(false) - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('homepage-contacts-meta', { kinds: [EventKind.meta], authors: notes.map((note) => note.pubkey), }) - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('homepage-contacts-reactions', { kinds: [EventKind.reaction], '#e': notes.map((note) => note.id ?? ''), }) diff --git a/frontend/Pages/LandingPage/Loader/index.tsx b/frontend/Pages/LandingPage/Loader/index.tsx index 8bdddf9..1c93e6b 100644 --- a/frontend/Pages/LandingPage/Loader/index.tsx +++ b/frontend/Pages/LandingPage/Loader/index.tsx @@ -19,7 +19,7 @@ export const Loader: React.FC = () => { useEffect(() => { if (!loadingRelayPool && !loadingDb && publicKey) { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('loading-meta', { kinds: [EventKind.petNames, EventKind.meta], authors: [publicKey], }) @@ -37,7 +37,7 @@ export const Loader: React.FC = () => { setContactsCount(results.length) if (publicKey && results && results.length > 0) { const authors = [...results.map((user: User) => user.id), publicKey] - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('loading-notes', { kinds: [EventKind.meta, EventKind.textNote], authors, since: moment().unix() - 86400 * 2, diff --git a/frontend/Pages/MentionsPage/index.tsx b/frontend/Pages/MentionsPage/index.tsx index 6b597dd..1282c65 100644 --- a/frontend/Pages/MentionsPage/index.tsx +++ b/frontend/Pages/MentionsPage/index.tsx @@ -26,12 +26,12 @@ export const MentionsPage: React.FC = () => { const subscribeNotes: () => void = async () => { if (!database || !publicKey) return - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('mentions-user-user', { kinds: [EventKind.textNote], '#p': [publicKey], limit: pageSize, }) - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('mentions-user-answers', { kinds: [EventKind.textNote], '#e': [publicKey], limit: pageSize, @@ -42,7 +42,7 @@ export const MentionsPage: React.FC = () => { if (database && publicKey) { getMentionNotes(database, publicKey, pageSize).then((notes) => { setNotes(notes) - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('mentions-notes-answers', { kinds: [EventKind.reaction], '#e': notes.map((note) => note.id ?? ''), }) @@ -50,7 +50,7 @@ export const MentionsPage: React.FC = () => { .filter((note) => !note.picture || note.picture === '') .map((note) => note.pubkey) if (missingDataNotes.length > 0) { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('mentions-meta', { kinds: [EventKind.meta], authors: missingDataNotes, }) diff --git a/frontend/Pages/NotePage/index.tsx b/frontend/Pages/NotePage/index.tsx index efeb050..c169602 100644 --- a/frontend/Pages/NotePage/index.tsx +++ b/frontend/Pages/NotePage/index.tsx @@ -67,7 +67,7 @@ export const NotePage: React.FC = () => { kinds: [EventKind.meta], authors: [...rootReplies.map((note) => note.pubkey), event.pubkey], } - relayPool?.subscribe('main-channel', message) + relayPool?.subscribe('meta-notepage', message) } else { setReplies([]) } @@ -81,11 +81,11 @@ export const NotePage: React.FC = () => { const subscribeNotes: (past?: boolean) => Promise = async (past) => { if (database && eventId) { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('main-notepage', { kinds: [EventKind.textNote], ids: [eventId], }) - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('answers-notepage', { kinds: [EventKind.reaction, EventKind.textNote], '#e': [eventId], }) diff --git a/frontend/Pages/ProfilePage/index.tsx b/frontend/Pages/ProfilePage/index.tsx index eccb4aa..fdc35a9 100644 --- a/frontend/Pages/ProfilePage/index.tsx +++ b/frontend/Pages/ProfilePage/index.tsx @@ -85,7 +85,7 @@ export const ProfilePage: React.FC = () => { getNotes(database, { filters: { pubkey: userId }, limit: pageSize }).then((results) => { setNotes(results) setRefreshing(false) - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('answers-profile', { kinds: [EventKind.reaction], '#e': results.map((note) => note.id ?? ''), }) @@ -101,11 +101,11 @@ export const ProfilePage: React.FC = () => { authors: [userId], limit: pageSize, } - relayPool?.subscribe('main-channel', message) + relayPool?.subscribe('main-profile', message) } const subscribeProfile: () => Promise = async () => { - relayPool?.subscribe('main-channel', { + relayPool?.subscribe('user-profile', { kinds: [EventKind.meta, EventKind.petNames], authors: [userId], })