From 3894188563d5b079caacca8d1419c44383022a87 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 21 Jan 2026 20:45:38 +0000 Subject: [PATCH] refactor: exclude client tags from NIP-29 and zap requests Remove client tag support from NIP-29 adapter events and zap requests as these events may be rejected by servers with large tags or have specific size constraints. Changes: - Removed client tag from NIP-29 chat messages (kind 9) - Removed client tag from NIP-29 reactions (kind 7) - Removed client tag from NIP-29 join/leave requests (kind 9021, 9022) - Removed client tag from NIP-29 group bookmarks (kind 10009) - Removed client tag from zap requests (kind 9734) Client tags remain enabled for: - Regular posts (kind 1) - Spell publishing (kind 777) - Event deletion (kind 5) This ensures maximum compatibility with relay servers and LNURL endpoints while still providing client identification for standard events. --- src/lib/chat/adapters/nip-29-adapter.ts | 32 ------------------------- src/lib/create-zap-request.ts | 7 ------ 2 files changed, 39 deletions(-) diff --git a/src/lib/chat/adapters/nip-29-adapter.ts b/src/lib/chat/adapters/nip-29-adapter.ts index 81f0bc1..fd6b826 100644 --- a/src/lib/chat/adapters/nip-29-adapter.ts +++ b/src/lib/chat/adapters/nip-29-adapter.ts @@ -25,8 +25,6 @@ import { GroupMessageBlueprint, ReactionBlueprint, } from "applesauce-common/blueprints"; -import { settingsManager } from "@/services/settings"; -import { GRIMOIRE_CLIENT_TAG } from "@/constants/app"; /** * NIP-29 Adapter - Relay-Based Groups @@ -473,11 +471,6 @@ export class Nip29Adapter extends ChatProtocolAdapter { } } - // Add client tag if enabled in settings - if (settingsManager.getSetting("includeClientTag")) { - draft.tags.push(GRIMOIRE_CLIENT_TAG); - } - // Sign the event const event = await factory.sign(draft); @@ -535,11 +528,6 @@ export class Nip29Adapter extends ChatProtocolAdapter { // Add h-tag for group context (NIP-29 specific) draft.tags.push(["h", groupId]); - // Add client tag if enabled in settings - if (settingsManager.getSetting("includeClientTag")) { - draft.tags.push(GRIMOIRE_CLIENT_TAG); - } - // Sign the event const event = await factory.sign(draft); @@ -880,11 +868,6 @@ export class Nip29Adapter extends ChatProtocolAdapter { ["relay", relayUrl], ]; - // Add client tag if enabled in settings - if (settingsManager.getSetting("includeClientTag")) { - tags.push(GRIMOIRE_CLIENT_TAG); - } - const draft = await factory.build({ kind: 9021, content: "", @@ -921,11 +904,6 @@ export class Nip29Adapter extends ChatProtocolAdapter { ["relay", relayUrl], ]; - // Add client tag if enabled in settings - if (settingsManager.getSetting("includeClientTag")) { - tags.push(GRIMOIRE_CLIENT_TAG); - } - const draft = await factory.build({ kind: 9022, content: "", @@ -1006,11 +984,6 @@ export class Nip29Adapter extends ChatProtocolAdapter { // Add the new group tag (use normalized URL for consistency) tags.push(["group", groupId, normalizedRelayUrl]); - // Add client tag if enabled in settings - if (settingsManager.getSetting("includeClientTag")) { - tags.push(GRIMOIRE_CLIENT_TAG); - } - // Create and publish the updated event const factory = new EventFactory(); factory.setSigner(activeSigner); @@ -1067,11 +1040,6 @@ export class Nip29Adapter extends ChatProtocolAdapter { throw new Error("Group is not in your list"); } - // Add client tag if enabled in settings - if (settingsManager.getSetting("includeClientTag")) { - tags.push(GRIMOIRE_CLIENT_TAG); - } - // Create and publish the updated event const factory = new EventFactory(); factory.setSigner(activeSigner); diff --git a/src/lib/create-zap-request.ts b/src/lib/create-zap-request.ts index 0e8cbf2..2381564 100644 --- a/src/lib/create-zap-request.ts +++ b/src/lib/create-zap-request.ts @@ -8,8 +8,6 @@ import type { NostrEvent } from "@/types/nostr"; import type { EventPointer, AddressPointer } from "./open-parser"; import accountManager from "@/services/accounts"; import { selectZapRelays } from "./zap-relay-selection"; -import { settingsManager } from "@/services/settings"; -import { GRIMOIRE_CLIENT_TAG } from "@/constants/app"; export interface EmojiTag { shortcode: string; @@ -130,11 +128,6 @@ export async function createZapRequest( } } - // Add client tag if enabled in settings - if (settingsManager.getSetting("includeClientTag")) { - tags.push(GRIMOIRE_CLIENT_TAG); - } - // Create event template const template = { kind: 9734,