Fix adding of a bookmark

This commit is contained in:
Schimon Jehudah 2024-03-13 13:25:49 +00:00
parent 7c197c2343
commit b0fff01c22
5 changed files with 7 additions and 9 deletions

View file

@ -67,8 +67,6 @@ class Config:
return result return result
async def set_setting_value(settings, jid_bare, db_file, key, val): async def set_setting_value(settings, jid_bare, db_file, key, val):
print('key and val (inside)')
print(key, val)
key = key.lower() key = key.lower()
key_val = [key, val] key_val = [key, val]
settings[jid_bare][key] = val settings[jid_bare][key] = val

View file

@ -1,2 +1,2 @@
__version__ = '0.1.40' __version__ = '0.1.41'
__version_info__ = (0, 1, 40) __version_info__ = (0, 1, 41)

View file

@ -40,9 +40,6 @@ class XmppBookmark:
result = await self.plugin['xep_0048'].get_bookmarks() result = await self.plugin['xep_0048'].get_bookmarks()
conferences = result['private']['bookmarks']['conferences'] conferences = result['private']['bookmarks']['conferences']
groupchats = [] groupchats = []
for conference in conferences:
if conference['jid'] != properties['jid']:
groupchats.extend([conference])
if properties: if properties:
properties['jid'] = properties['room'] + '@' + properties['host'] properties['jid'] = properties['room'] + '@' + properties['host']
if not properties['alias']: properties['alias'] = self.alias if not properties['alias']: properties['alias'] = self.alias
@ -54,6 +51,9 @@ class XmppBookmark:
'autojoin' : True, 'autojoin' : True,
'password' : None, 'password' : None,
} }
for conference in conferences:
if conference['jid'] != properties['jid']:
groupchats.extend([conference])
# FIXME Ad-hoc bookmark form is stuck # FIXME Ad-hoc bookmark form is stuck
# if jid not in groupchats: # if jid not in groupchats:
if properties['jid'] not in groupchats: if properties['jid'] not in groupchats:

View file

@ -294,7 +294,8 @@ class Slixfeed(slixmpp.ClientXMPP):
# self.send_presence() # self.send_presence()
profile.set_identity(self, 'client') profile.set_identity(self, 'client')
self['xep_0115'].update_caps() self['xep_0115'].update_caps()
XmppGroupchat.autojoin(self) bookmarks = await self.plugin['xep_0048'].get_bookmarks()
XmppGroupchat.autojoin(self, bookmarks)
time_end = time.time() time_end = time.time()
difference = time_end - time_begin difference = time_end - time_begin
if difference > 1: logger.warning('{} (time: {})'.format(function_name, if difference > 1: logger.warning('{} (time: {})'.format(function_name,

View file

@ -822,7 +822,6 @@ async def message(self, message):
db_file = config.get_pathname_to_database(jid_file) db_file = config.get_pathname_to_database(jid_file)
key = 'old' key = 'old'
val = 0 val = 0
print('key and val (outside)')
await Config.set_setting_value(self.settings, jid_bare, await Config.set_setting_value(self.settings, jid_bare,
db_file, key, val) db_file, key, val)
response = 'Only new items of newly added feeds be delivered.' response = 'Only new items of newly added feeds be delivered.'