Skip to content

Commit

Permalink
Fix bookmarks2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Oct 8, 2023
1 parent 9345cda commit f1d0910
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Monal/Classes/MLPubSubProcessor.m
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@ @implementation MLPubSubProcessor
NSString* nick = [[DataLayer sharedInstance] ownNickNameforMuc:room forAccount:account.accountNo];
if(nick != nil)
{
if(![item check:@"nick"])
[item addChildNode:[[MLXMLNode alloc] initWithElement:@"nick"]];
((MLXMLNode*)[item findFirst:@"nick"]).data = nick;
if(![item check:@"{urn:xmpp:bookmarks:1}conference/nick"])
[[item findFirst:@"{urn:xmpp:bookmarks:1}conference"] addChildNode:[[MLXMLNode alloc] initWithElement:@"nick"]];
((MLXMLNode*)[item findFirst:@"{urn:xmpp:bookmarks:1}conference/nick"]).data = nick;
}

//update autojoin value to true
item.attributes[@"autojoin"] = @"true";
[item findFirst:@"{urn:xmpp:bookmarks:1}conference"].attributes[@"autojoin"] = @"true";

//publish this bookmark item again
[account.pubsub publishItem:item onNode:@"urn:xmpp:bookmarks:1" withConfigOptions:@{
Expand Down

0 comments on commit f1d0910

Please sign in to comment.