diff --git a/android/app/src/main/java/com/nostros/classes/Database.java b/android/app/src/main/java/com/nostros/classes/Database.java index 80f46da3..146ce09d 100644 --- a/android/app/src/main/java/com/nostros/classes/Database.java +++ b/android/app/src/main/java/com/nostros/classes/Database.java @@ -259,6 +259,9 @@ public Database(String absoluteFilesPath) { try { instance.execSQL("ALTER TABLE nostros_notifications ADD COLUMN zapper_user_id TEXT;"); } catch (SQLException e) { } + try { + instance.execSQL("UPDATE nostros_lists SET kind=10003 WHERE kind=10001;"); // FIXME Remove after including kind 10003 + } catch (SQLException e) { } } public boolean saveEvent(JSONObject data, String userPubKey, String relayUrl) throws JSONException { diff --git a/android/app/src/main/java/com/nostros/classes/Event.java b/android/app/src/main/java/com/nostros/classes/Event.java index 5907bc5e..84dc1979 100644 --- a/android/app/src/main/java/com/nostros/classes/Event.java +++ b/android/app/src/main/java/com/nostros/classes/Event.java @@ -82,7 +82,7 @@ public boolean save(SQLiteDatabase database, String userPubKey, String relayUrl) saveRelayMetadata(database); } else if (kind.equals("9735")) { return saveZap(database, userPubKey); - } else if (kind.equals("10000") || kind.equals("10001") || kind.equals("30001")) { + } else if (kind.equals("10000") || kind.equals("10003")) { saveList(database); } } catch (JSONException e) { diff --git a/frontend/Contexts/UserContext.tsx b/frontend/Contexts/UserContext.tsx index 499022dc..7347e8e1 100644 --- a/frontend/Contexts/UserContext.tsx +++ b/frontend/Contexts/UserContext.tsx @@ -116,7 +116,7 @@ export const UserContextProvider = ({ children }: UserContextProviderProps): JSX const reloadBookmarks: () => void = () => { if (database && publicKey && privateKey) { - getList(database, 10001, publicKey).then((result) => { + getList(database, 10003, publicKey).then((result) => { if (result) { const eTags = getETags(result) setPublicBookmarks(eTags.map((tag) => tag[1])) diff --git a/frontend/Functions/RelayFunctions/Lists/index.ts b/frontend/Functions/RelayFunctions/Lists/index.ts index b685c825..525257b4 100644 --- a/frontend/Functions/RelayFunctions/Lists/index.ts +++ b/frontend/Functions/RelayFunctions/Lists/index.ts @@ -14,7 +14,7 @@ export const addBookmarkList: ( ) => void = async (sendEvent, database, privateKey, publicKey, eventId, publicBookmark) => { if (!eventId || eventId === '') return - const result = await getList(database, 10001, publicKey) + const result = await getList(database, 10003, publicKey) let tags: string[][] = result?.tags ?? [] let content: string = result?.content ?? '' if (publicBookmark) { @@ -34,7 +34,7 @@ export const addBookmarkList: ( const event: Event = { content, created_at: getUnixTime(new Date()), - kind: 10001, + kind: 10003, pubkey: publicKey, tags, } @@ -97,7 +97,7 @@ export const removeBookmarkList: ( ) => void = async (sendEvent, database, privateKey, publicKey, eventId) => { if (!eventId || eventId === '') return - const result = await getList(database, 10001, publicKey) + const result = await getList(database, 10003, publicKey) if (result) { let content: string = result?.content ?? '' const tags = result.tags.filter((tag) => tag[1] !== eventId) @@ -110,7 +110,7 @@ export const removeBookmarkList: ( const event: Event = { content, created_at: getUnixTime(new Date()), - kind: 10001, + kind: 10003, pubkey: publicKey, tags, } diff --git a/frontend/Pages/HomePage/index.tsx b/frontend/Pages/HomePage/index.tsx index f0db03af..7934ee78 100644 --- a/frontend/Pages/HomePage/index.tsx +++ b/frontend/Pages/HomePage/index.tsx @@ -39,7 +39,7 @@ export const HomePage: React.FC = () => { authors: [publicKey], }, { - kinds: [10001], + kinds: [10003], limit: 1, authors: [publicKey], }, diff --git a/frontend/Pages/ProfileLoadPage/SecondStep/index.tsx b/frontend/Pages/ProfileLoadPage/SecondStep/index.tsx index 0a72e0b7..2f3a7aff 100644 --- a/frontend/Pages/ProfileLoadPage/SecondStep/index.tsx +++ b/frontend/Pages/ProfileLoadPage/SecondStep/index.tsx @@ -49,7 +49,7 @@ export const SecondStep: React.FC = ({ nextStep, skip }) => { authors: [publicKey], }, { - kinds: [10001], + kinds: [10003], limit: 1, authors: [publicKey], }, diff --git a/frontend/Pages/ProfilePage/BookmarksFeed/index.tsx b/frontend/Pages/ProfilePage/BookmarksFeed/index.tsx index c5469e18..576b8204 100644 --- a/frontend/Pages/ProfilePage/BookmarksFeed/index.tsx +++ b/frontend/Pages/ProfilePage/BookmarksFeed/index.tsx @@ -53,12 +53,12 @@ export const BookmarksFeed: React.FC = ({ if (database) { const filters: RelayFilters[] = [ { - kinds: [10001], + kinds: [10003], limit: 1, authors: [publicKey], }, ] - getList(database, 10001, publicKey).then((result) => { + getList(database, 10003, publicKey).then((result) => { if (result) { const eTags = getETags(result) if (eTags.length > 0) { @@ -75,7 +75,7 @@ export const BookmarksFeed: React.FC = ({ const loadNotes: () => void = async () => { if (database) { - const bookmarks = await getList(database, 10001, publicKey) + const bookmarks = await getList(database, 10003, publicKey) const eTags = getETags(bookmarks).map((tag) => tag[1]) if (eTags.length > 0) { getNotes(database, { filters: { id: eTags } }).then((results) => { diff --git a/frontend/Pages/ProfilePage/index.tsx b/frontend/Pages/ProfilePage/index.tsx index b9147178..7d0845f5 100644 --- a/frontend/Pages/ProfilePage/index.tsx +++ b/frontend/Pages/ProfilePage/index.tsx @@ -108,7 +108,7 @@ export const ProfilePage: React.FC = ({ route }) => { authors: [route.params.pubKey], }, { - kinds: [10001], + kinds: [10003], limit: 1, authors: [route.params.pubKey], },