Add URI for Service Discovery (XEP-0030);
Remove scheme "xmpp" from local@hostname (was xmpp:local@hostname); Add more notes to the README document.
This commit is contained in:
parent
0d2e55fa14
commit
16338fabb2
2 changed files with 23 additions and 10 deletions
11
README.md
11
README.md
|
@ -10,13 +10,15 @@ browsers.
|
|||
It also provides an interface to explore XMPP server conferences, pubsub and
|
||||
other services.
|
||||
|
||||
### Reasons for creating of FASI
|
||||
### Reasons for creating FASI
|
||||
|
||||
The main reasons for the realization of FASI are:
|
||||
|
||||
- Add interactive capabilities, as well as vCard information;
|
||||
- Create rapport with the viewers, by displaying vCard information, such as Full
|
||||
Name and Description or Note;
|
||||
- Realize the beautiful simplicity of XMPP, so that more people would be
|
||||
motivated to utilize, install, serve, and develop XMPP software;
|
||||
- Charm our "normie" friends, so called, by displaying an attractive contact
|
||||
HTML page, which they can also utilize;
|
||||
- Utilize an invitation page, with XMPP capabilities, regardless to the software
|
||||
|
@ -84,7 +86,12 @@ AGPL-3.0-only
|
|||
|
||||
Schimon Jehudah Zachary 2024
|
||||
|
||||
# Similar Projects
|
||||
## Thanks
|
||||
|
||||
A special thank you for Mr. Georg Lukas who has exposed the HTML invitation page
|
||||
to the founder of this project.
|
||||
|
||||
## Similar Projects
|
||||
|
||||
- [Easy XMPP Invitation Landing Page](https://github.com/modernxmpp/easy-xmpp-invitation) from Mr. Georg Lukas;
|
||||
- [mod_invite](https://modules.prosody.im/mod_invite.html) module for Prosody.
|
||||
|
|
22
fasi.py
22
fasi.py
|
@ -94,7 +94,7 @@ class HttpInstance:
|
|||
title = node_name
|
||||
link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name)
|
||||
link_text = 'Subscribe'
|
||||
xmpp_uri = 'xmpp:{}?;node={}'.format(jid_bare, node_name)
|
||||
xmpp_uri = '{}?;node={}'.format(jid_bare, node_name)
|
||||
|
||||
# Start an XMPP instance and retrieve information
|
||||
xmpp_instance = XmppInstance(jabber_id, password, jid_bare)
|
||||
|
@ -328,23 +328,26 @@ class HttpInstance:
|
|||
message = '{}: {} (XEP-0030)'.format(jid_info['text'], jid_info['condition'])
|
||||
action = 'Connect with'
|
||||
link_text = 'Connect'
|
||||
link_href = xmpp_uri = 'xmpp:{}'.format(jid_bare)
|
||||
link_href = 'xmpp:{}'.format(jid_bare)
|
||||
xmpp_uri = jid_bare
|
||||
elif jid_kind in ('conference', 'server'):
|
||||
action = link_text = 'Discover'
|
||||
if jid_kind == 'conference':
|
||||
instance = 'conferences'
|
||||
elif jid_kind == 'server':
|
||||
instance = 'services'
|
||||
link_href = xmpp_uri = 'xmpp:{}'.format(jid_bare)
|
||||
link_href = 'xmpp:{}?disco;type=get;request=items'.format(jid_bare)
|
||||
view_href = '/d/' + jid_bare
|
||||
xmpp_uri = jid_bare
|
||||
elif jid_kind in ('mix', 'muc'):
|
||||
#title = 'Group Chat ' + title
|
||||
# TODO Set group chat subject as description.
|
||||
action = 'Join to'
|
||||
instance = 'participants'
|
||||
link_text = 'Join'
|
||||
link_href = xmpp_uri = 'xmpp:{}?join'.format(jid_bare)
|
||||
link_href = 'xmpp:{}?join'.format(jid_bare)
|
||||
view_href = '/v/' + jid_bare
|
||||
xmpp_uri = jid_bare
|
||||
# room_info = await XmppXep0045.get_room_data(xmpp_instance, jid_bare)
|
||||
# breakpoint()
|
||||
elif jid_kind == 'pubsub':
|
||||
|
@ -353,19 +356,22 @@ class HttpInstance:
|
|||
action = 'Subscribe to'
|
||||
instance = 'articles'
|
||||
link_text = 'Subscribe'
|
||||
link_href = xmpp_uri = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name)
|
||||
link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name)
|
||||
view_href = '/d/{}/{}'.format(jid_bare, node_name)
|
||||
xmpp_uri = '{}?;node={}'.format(jid_bare, node_name)
|
||||
else:
|
||||
action = link_text = 'Browse'
|
||||
instance = 'nodes'
|
||||
link_href = xmpp_uri = 'xmpp:{}'.format(jid_bare)
|
||||
link_href = 'xmpp:{}?disco;type=get;request=items'.format(jid_bare)
|
||||
view_href = '/d/' + jid_bare
|
||||
xmpp_uri = jid_bare
|
||||
else:
|
||||
action = link_text = 'Message'
|
||||
instance = 'articles'
|
||||
link_href = xmpp_uri = 'xmpp:{}?message'.format(jid_bare)
|
||||
link_href = 'xmpp:{}?message'.format(jid_bare)
|
||||
node_name = 'urn:xmpp:microblog:0'
|
||||
view_href = '/d/{}/{}'.format(jid_bare, node_name)
|
||||
xmpp_uri = jid_bare
|
||||
|
||||
# JID item count
|
||||
count = None
|
||||
|
@ -465,7 +471,7 @@ class HttpInstance:
|
|||
xmpp_instance.disconnect()
|
||||
|
||||
# QR code
|
||||
Graphics.generate_qr_code_graphics_from_string(xmpp_uri, jid_bare)
|
||||
Graphics.generate_qr_code_graphics_from_string(link_href, jid_bare)
|
||||
|
||||
except Exception as e:
|
||||
exception = str(e)
|
||||
|
|
Loading…
Reference in a new issue