Add a dynamic message in accord to JID purpose (Thanks to Ramiro from Above Phone and TBOT).

This commit is contained in:
Schimon Jehudah, Adv. 2024-10-14 14:37:18 +03:00
parent 26d92eff7c
commit 0b85570631
3 changed files with 64 additions and 30 deletions

12
fasi.py
View file

@ -128,7 +128,7 @@ class HttpInstance:
elif jid_kind in ('mix', 'muc'):
#title = 'Group Chat ' + title
# TODO Set group chat subject as description.
action = 'Join to'
action = 'Join'
instance = 'participants'
link_href = 'xmpp:{}?join'.format(jid_bare)
links.append({'name' : 'Join',
@ -141,7 +141,7 @@ class HttpInstance:
elif jid_kind == 'pubsub':
#node_name = request.query_params.get('node', '')
if node_name:
action = 'Subscribe to'
action = 'Subscribe'
instance = 'articles'
link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name)
view_href = '/d/{}/{}'.format(jid_bare, node_name)
@ -373,7 +373,7 @@ class HttpInstance:
elif jid_kind in ('mix', 'muc'):
#title = 'Group Chat ' + title
# TODO Set group chat subject as description.
action = 'Join to'
action = 'Join'
instance = 'participants'
link_href = 'xmpp:{}?join'.format(jid_bare)
links.append({'name' : 'Join',
@ -386,7 +386,7 @@ class HttpInstance:
elif jid_kind == 'pubsub':
#node_name = request.query_params.get('node', '')
if node_name:
action = 'Subscribe to'
action = 'Subscribe'
instance = 'articles'
link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name)
view_href = '/d/{}/{}'.format(jid_bare, node_name)
@ -770,7 +770,7 @@ class HttpInstance:
elif jid_kind in ('mix', 'muc'):
#title = 'Group Chat ' + title
# TODO Set group chat subject as description.
action = 'Join to'
action = 'Join'
instance = 'participants'
link_href = 'xmpp:{}?join'.format(jid_bare)
links.append(['Join', link_href])
@ -781,7 +781,7 @@ class HttpInstance:
elif jid_kind == 'pubsub':
#node_name = request.query_params.get('node', '')
if node_name:
action = 'Subscribe to'
action = 'Subscribe'
instance = 'articles'
link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name)
links.append(['Subscribe', link_href])