After 14 months of hard work, we are extremly proud to announce the first public preview of JSXC 4.0. It is a total rewrite and brings you long-awaited features like OMEMO, MUC invitation, voice-only call, JID escaping, experimental multi account support, and much more. The release is thought to collect feedback from administrators and plugin implementors about APIs and the overall design. Please do not use it in production yet!
You can download this release as usual from our release page or try our new nightly demo site.
This huge release step will result in a lot of breaking changes, therefore we will explain in the next sections how you can install JSXC 4.0-alpha.1, which work still has to be done before the stable release, and which points are open for discussion. At the very end, you will find the preliminary change log and some screenshots.
Installation
The installation is now quite a bit easier, but does not yet provide all the options you know from JSXC 3.x. See the next two sections (Public API and Still pending) for details.
- Download and extract the release archive to your web root.
- Include the following files into your page:
styles/jsxc.bundle.css
jsxc.bundle.js
- JQuery (3.x)
- If you like to use OMEMO, download libsignal and include its
dist/libsignal-protocol.js
. JSXC will then automatically detect it upon initialization. - Initialize JSXC with
jsxc.init()
and use eitherjsxc.start()
orjsxc.watchForm()
.
Public API
Our new API is now much cleaner and encapsulated. This means you can't call internal functions, like done before. Currently we provide the following functions:
jsxc.init
Like before, you have to initialize JSXC with some options so it can learn about your environment.
init(options: Options)
interface Options {
/** name of container application (e.g. Nextcloud or SOGo) */
app_name = 'web applications';
/** Default language */
defaultLang = 'en';
/** Place for roster */
rosterAppend = 'body';
RTCPeerConfig = {
/** Time-to-live for config from url */
ttl: 3600,
/** ICE servers like defined in http://www.w3.org/TR/webrtc/#idl-def-RTCIceServer */
iceServers: [{
urls: 'stun:stun.stunprotocol.org'
}]
};
onlineHelp = 'http://www.jsxc.org/manual.html';
disabledPlugins: Array<string> = [];
connectionCallback: (jid: string, status: number, condition?: string) => void = null;
/** If the user requests to go online again, this function is called. Default: The login dialog is shown. */
onUserRequestsToGoOnline: () => void = loginDialog;
/** If user tries to login with login dialog, this value is used as BOSH url. */
xmppBoshUrl: string = undefined;
}
jsxc.start
Start JSXC with either (a) credentials from a prebind session, (b) Jabber Id and password, or (c) just the UI. The latter provides the user with the plain roster.
start(boshUrl: string, jid: string, sid: string, rid: string);
start(boshUrl: string, jid: string, password: string);
start();
jsxc.enableDebugMode
Enable debug mode for more log messages.
enableDebugMode()
jsxc.register
Register a new user account with XEP-0077.
register(service: string, domain: string, callback?: (form: Form) => Promise<Form>)
More
You find all APIs in src/api/
or in our new, still under development, readthedocs page.
Still pending
Although we accomplished a lot in these months, we still have some work to do. The following list is in decreasing order of importance.
- Options: In JSXC 4.0, we aim to provide a lightweight API which fits most use cases. We know that there are currently some options missing with respect to the 3.x branch, and we are working hard to bring most of them back to you. If you need something specific or just want to drop your 2 cents, please look at the next section.
- Accessibility: Improve accessibility for people with screen reader or keyboard use.
- Bookmarks: Bookmark support should be back by the final release.
- Avatar upload: Update avatar inside JSXC. See #304
- OMEMO ignore keys: It would be desirable if users could choose to ignore some OMEMO keys.
- System message icons: In 3.x, system messages with icons were possible.
- Last message correction: XEP-0308: Last Message Correction would be nice to have.
Discussion
The current public API is mainly available directly under the jsxc
namespace and can be called in any order. This means people can call jsxc.start
before they call jsxc.init
which is obviously a bad idea. A more chain-based approach could help here. This means jsxc.init
would return the API which can only be called after the init method. This could also be handy in a multi-account setup, where you could get account specific APIs after calling some jsxc.getAccount
method. What do you think?
Changelog
Added
- OMEMO (XEP-0384)
- MUC invitation
- #6 voice-only call
- #501 JID escaping (XEP-0106)
- #178 add in-band password change (XEP-0077)
- #178 add in-band registration (XEP-0077)
- send file via file drop
- insert emoticon at cursor position
- MUC subject in window header
- full screen layout
- display presence messages
- option to disable all plugins
- highlight quotations
- show notice if offline contacts are hidden
- prepared multi account support (still experimental)
Fixed
- video calls can now be initiated from any tab
- #328 MUC joining from any tab
- fix and improve emoticon insertion
- remove non-persistent contacts after login
- translate OTR status messages
Changed
- use Consistent Color Generation (XEP-0392)
- use more natural bounce animation for notice icon
Developer notes
- Typescript, Webpack, Handlebars, Karma, Mocha, Chai and Sinon
- removed
build
anddoc
folder, git submodules, bower and grunt - share one XMPP connection across all tabs
- add plugin API
- form watcher instead of form option
- API to add roster menu entries (
jsxc.addMenuEntry()
) - API to test BOSH server (
jsxc.testBOSHServer()
) - use SASS guidelines and BEM-like style syntax
Removed/Pending
- Jingle file transfer
- bookmarks