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.
This commit is contained in:
Claude
2026-01-21 20:45:38 +00:00
parent 192eaeb098
commit 3894188563
2 changed files with 0 additions and 39 deletions

View File

@@ -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);

View File

@@ -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,