File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
src/headless/plugins/bookmarks Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 12.0.1 (Unreleased)
4+
5+ - #3822 : Bookmark removal not working
6+
37## 12.0.0 (2025-08-28)
48
59- #3581 : Don't unnecessarily regenerate pot and po files
Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ class Bookmarks extends Collection {
3838 this . on (
3939 'remove' ,
4040 /** @param {Bookmark } bookmark */
41- ( _ , bookmark ) => this . sendBookmarkStanza ( bookmark ) ,
41+ ( bookmark , _ ) =>
42+ this . removeBookmark ( bookmark )
43+ . catch ( ( e ) => log . fatal ( e ) ) ,
4244 this
4345 ) ;
4446
@@ -182,6 +184,28 @@ class Bookmarks extends Collection {
182184 } ) ;
183185 }
184186
187+ /**
188+ * @param {Bookmark } bookmark
189+ * @returns {Promise<void|Element> }
190+ */
191+ async removeBookmark ( bookmark ) {
192+ const bare_jid = _converse . session . get ( 'bare_jid' ) ;
193+ const node = ( await api . disco . supports ( `${ Strophe . NS . BOOKMARKS2 } #compat` , bare_jid ) )
194+ ? Strophe . NS . BOOKMARKS2
195+ : Strophe . NS . BOOKMARKS ;
196+ const stanza = stx `
197+ <iq xmlns="jabber:client"
198+ from="${ bare_jid } "
199+ type="set">
200+ <pubsub xmlns="${ Strophe . NS . PUBSUB } ">
201+ <retract node="${ node } ">
202+ <item id="${ bookmark . get ( 'jid' ) } "/>
203+ </retract>
204+ </pubsub>
205+ </iq>` ;
206+ await api . sendIQ ( stanza ) ;
207+ }
208+
185209 /**
186210 * @param {Element } iq
187211 */
You can’t perform that action at this time.
0 commit comments