├── sound ├── Ping1.mp3 ├── Rotary-Phone6.mp3 ├── incomingMessage.mp3 └── credential ├── example ├── favicon.ico ├── ajax │ └── getturncredentials.json ├── css │ ├── images │ │ ├── ui-icons_444444_256x240.png │ │ ├── ui-icons_555555_256x240.png │ │ ├── ui-icons_777620_256x240.png │ │ ├── ui-icons_777777_256x240.png │ │ ├── ui-icons_cc0000_256x240.png │ │ └── ui-icons_ffffff_256x240.png │ └── example.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── js │ └── example.js └── login.html ├── images ├── loading.gif ├── XMPP_logo.png ├── composing.png ├── filetypes │ ├── audio.png │ ├── file.png │ ├── folder.png │ ├── image.png │ ├── text.png │ ├── video.png │ ├── application.png │ ├── text-code.png │ ├── text-vcard.png │ ├── folder-public.png │ ├── folder-shared.png │ ├── text-calendar.png │ ├── application-pdf.png │ ├── folder-external.png │ ├── folder-starred.png │ ├── folder-drag-accept.png │ ├── package-x-generic.png │ ├── x-office-document.png │ ├── x-office-presentation.png │ ├── x-office-spreadsheet.png │ ├── text-code.svg │ ├── folder-drag-accept.svg │ ├── video.svg │ ├── x-office-presentation.svg │ ├── package-x-generic.svg │ ├── folder.svg │ ├── folder-starred.svg │ ├── file.svg │ ├── text.svg │ ├── image.svg │ ├── x-office-document.svg │ ├── x-office-spreadsheet.svg │ ├── folder-external.svg │ ├── audio.svg │ ├── text-calendar.svg │ ├── folder-shared.svg │ ├── folder-public.svg │ └── application.svg ├── menu_black.svg ├── camera_icon_black.svg ├── menu_white.svg ├── camera_icon_grey.svg ├── bookmark_black.svg ├── bookmark_white.svg ├── camera_icon_white.svg ├── edit_black.svg ├── fullscreen_black.svg ├── edit_white.svg ├── fullscreen_white.svg ├── bookmark_red.svg ├── location_icon.svg ├── speech_balloon_black.svg ├── close_black.svg ├── speech_balloon_white.svg ├── delete_black.svg ├── close_white.svg ├── delete_white.svg ├── resize_gray.svg ├── help_black.svg ├── more_black.svg ├── help_white.svg ├── more_white.svg ├── info_black.svg ├── info_white.svg ├── bell.svg ├── hang_up_black.svg ├── hang_up_red.svg ├── hang_up_white.svg ├── pick_up_black.svg ├── pick_up_green.svg ├── pick_up_white.svg ├── microphone_black.svg ├── attachment.svg ├── microphone_white.svg ├── camera_disabled_icon_black.svg ├── dragover_white.svg ├── drop_white.svg ├── camera_disabled_icon_white.svg ├── padlock_close_green.svg ├── padlock_close_orange.svg ├── padlock_open_black.svg ├── padlock_open_white.svg ├── minimize_black.svg ├── contact_black.svg ├── contact_white.svg ├── download_icon_black.svg ├── download_icon_white.svg ├── megaphone_icon_black.svg ├── smiley.svg ├── microphone_disabled_black.svg ├── microphone_disabled_white.svg ├── pick_up_white_disabled.svg ├── mute_black.svg ├── padlock_open_disabled_black.svg ├── presence │ └── online.svg └── XMPP_logo.svg ├── src ├── LinkHandler.interface.ts ├── plugins │ ├── omemo │ │ ├── model │ │ │ ├── Exportable.ts │ │ │ ├── RegistrationId.ts │ │ │ ├── SignedPreKey.ts │ │ │ ├── EncryptedDeviceMessage.ts │ │ │ ├── PreKey.ts │ │ │ └── IdentityKey.ts │ │ ├── util │ │ │ ├── Formatter.ts │ │ │ ├── Const.ts │ │ │ └── ArrayBuffer.ts │ │ ├── vendor │ │ │ ├── Address.ts │ │ │ ├── SignalStore.interface.ts │ │ │ ├── SessionCipher.ts │ │ │ ├── SessionBuilder.ts │ │ │ ├── Signal.ts │ │ │ └── KeyHelper.ts │ │ └── lib │ │ │ └── IdentityManager.ts │ ├── chatState │ │ ├── State.ts │ │ └── ChatStateConnection.ts │ ├── bookmarks │ │ ├── services │ │ │ ├── AbstractService.ts │ │ │ └── LocalService.ts │ │ ├── RoomBookmark.ts │ │ └── BookmarksPlugin.ts │ └── MeCommandPlugin.ts ├── Identifiable.interface.ts ├── errors │ ├── ParsingError.ts │ ├── ConnectionError.ts │ ├── AuthenticationError.ts │ ├── InvalidParameterError.ts │ └── BaseError.ts ├── index.ts ├── connection │ ├── FormItemField.ts │ ├── FormReportedField.ts │ ├── xmpp │ │ ├── AbstractHandler.ts │ │ ├── JingleHandler.ts │ │ ├── namespace.ts │ │ └── handlers │ │ │ ├── multiUser │ │ │ ├── Presence.ts │ │ │ ├── XMessage.ts │ │ │ └── DirectInvitation.ts │ │ │ ├── headlineMessage.ts │ │ │ └── jingle.ts │ └── services │ │ ├── AbstractService.ts │ │ ├── Disco.ts │ │ └── PEP.ts ├── Avatar.interface.ts ├── util │ ├── Log.interface.ts │ ├── Hash.ts │ ├── Color.ts │ ├── UUID.ts │ ├── PersistentArray.ts │ ├── Random.ts │ ├── HookRepository.ts │ ├── Pipe.ts │ ├── Translation.ts │ └── Utils.ts ├── plugin │ └── EncryptionPlugin.ts ├── ui │ ├── util │ │ ├── ByteBeautifier.ts │ │ ├── DateTime.ts │ │ ├── ElementHandler.ts │ │ └── TableElement.ts │ ├── Overlay.ts │ ├── dialogs │ │ ├── notification.ts │ │ ├── fingerprints.ts │ │ ├── about.ts │ │ ├── multiUserInvite.ts │ │ ├── confirm.ts │ │ ├── unknownSender.ts │ │ ├── selection.ts │ │ └── multiUserInvitation.ts │ ├── web.ts │ ├── DialogList.ts │ ├── DialogNavigation.ts │ ├── DialogSection.ts │ ├── DialogPage.ts │ ├── DialogListItem.ts │ └── ChatWindowFileTransferHandler.ts ├── StorableAbstract.ts ├── JID.interface.ts ├── JingleMediaSession.ts ├── DiscoInfo.interface.ts ├── bootstrap │ ├── webpackPublicPath.ts │ └── plugins.ts ├── api │ ├── v1 │ │ ├── disconnect.ts │ │ └── debug.ts │ └── index.ts ├── Client.interface.ts ├── ContactProvider.ts ├── vendor │ └── Strophe.ts ├── DiscoInfoRepository.interface.ts ├── PageVisibility.ts ├── Storage.interface.ts ├── LinkHandlerGeo.ts ├── CONST.ts ├── StateMachine.ts ├── Migration.ts ├── FallbackContactProvider.ts ├── DiscoInfoChangeable.ts ├── Avatar.ts └── JingleStreamSession.ts ├── scss ├── modules │ ├── _all.scss │ ├── _muc.scss │ ├── _webrtc.scss │ ├── _presence.scss │ ├── _scrollbar.scss │ └── _animation.scss ├── main.scss └── partials │ ├── _emoticons.scss │ ├── _avatar.scss │ └── _button.scss ├── template ├── notification.hbs ├── chatWindowList.hbs ├── vcard-body.hbs ├── confirm.hbs ├── helpers │ ├── breaklines.js │ ├── t.js │ └── tr.js ├── partials │ └── menu.hbs ├── dialog.hbs ├── chat-window-message.hbs ├── dialogOmemoDeviceList.hbs ├── debugLog.hbs ├── vcard.hbs ├── roster-form.hbs ├── selection.hbs ├── fingerprints.hbs ├── dialogOmemoDeviceItem.hbs ├── roster-item.hbs ├── videoDialog.hbs ├── about.hbs ├── multiUserInvite.hbs ├── multiUserInvitation.hbs ├── roster.hbs ├── loginBox.hbs ├── contact.hbs └── bookmark.hbs ├── .lgtm.yml ├── .gitignore ├── CONTRIBUTING.md ├── .editorconfig ├── .travis.yml ├── .npmignore ├── test ├── AccountStub.ts ├── connection │ └── xmpp │ │ └── handlers │ │ └── presence.spec.ts └── Client.ts ├── .stylelintrc ├── .commitlintrc.json ├── .vscode └── settings.json ├── .github └── ISSUE_TEMPLATE │ ├── feature-request.md │ └── bug_report.md ├── custom.d.ts ├── tslint.json ├── tsconfig.json ├── LICENSE └── scripts ├── prepare-commit-msg.js └── search-blacklist.js /sound/Ping1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/sound/Ping1.mp3 -------------------------------------------------------------------------------- /example/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/favicon.ico -------------------------------------------------------------------------------- /images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/loading.gif -------------------------------------------------------------------------------- /images/XMPP_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/XMPP_logo.png -------------------------------------------------------------------------------- /images/composing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/composing.png -------------------------------------------------------------------------------- /sound/Rotary-Phone6.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/sound/Rotary-Phone6.mp3 -------------------------------------------------------------------------------- /images/filetypes/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/audio.png -------------------------------------------------------------------------------- /images/filetypes/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/file.png -------------------------------------------------------------------------------- /images/filetypes/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/folder.png -------------------------------------------------------------------------------- /images/filetypes/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/image.png -------------------------------------------------------------------------------- /images/filetypes/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/text.png -------------------------------------------------------------------------------- /images/filetypes/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/video.png -------------------------------------------------------------------------------- /sound/incomingMessage.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/sound/incomingMessage.mp3 -------------------------------------------------------------------------------- /src/LinkHandler.interface.ts: -------------------------------------------------------------------------------- 1 | export interface ILinkHandler { 2 | detect(element: JQuery): void 3 | } 4 | -------------------------------------------------------------------------------- /src/plugins/omemo/model/Exportable.ts: -------------------------------------------------------------------------------- 1 | export default interface IExportable { 2 | export(): any 3 | } 4 | -------------------------------------------------------------------------------- /images/filetypes/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/application.png -------------------------------------------------------------------------------- /images/filetypes/text-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/text-code.png -------------------------------------------------------------------------------- /images/filetypes/text-vcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/text-vcard.png -------------------------------------------------------------------------------- /images/filetypes/folder-public.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/folder-public.png -------------------------------------------------------------------------------- /images/filetypes/folder-shared.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/folder-shared.png -------------------------------------------------------------------------------- /images/filetypes/text-calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/text-calendar.png -------------------------------------------------------------------------------- /images/filetypes/application-pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/application-pdf.png -------------------------------------------------------------------------------- /images/filetypes/folder-external.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/folder-external.png -------------------------------------------------------------------------------- /images/filetypes/folder-starred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/folder-starred.png -------------------------------------------------------------------------------- /images/filetypes/folder-drag-accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/folder-drag-accept.png -------------------------------------------------------------------------------- /images/filetypes/package-x-generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/package-x-generic.png -------------------------------------------------------------------------------- /images/filetypes/x-office-document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/x-office-document.png -------------------------------------------------------------------------------- /example/ajax/getturncredentials.json: -------------------------------------------------------------------------------- 1 | {"url":"numb.viagenie.ca","username":"webrtc@live.com","credential":"muazkh","ttl":43200} 2 | -------------------------------------------------------------------------------- /images/filetypes/x-office-presentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/x-office-presentation.png -------------------------------------------------------------------------------- /images/filetypes/x-office-spreadsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/images/filetypes/x-office-spreadsheet.png -------------------------------------------------------------------------------- /src/Identifiable.interface.ts: -------------------------------------------------------------------------------- 1 | 2 | interface IIdentifiable { 3 | getId(): string 4 | } 5 | 6 | export default IIdentifiable; 7 | -------------------------------------------------------------------------------- /example/css/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/css/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /example/css/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/css/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /example/css/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/css/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /example/css/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/css/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /example/css/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/css/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /example/css/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/css/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /example/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /example/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /example/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/errors/ParsingError.ts: -------------------------------------------------------------------------------- 1 | import BaseError from './BaseError' 2 | 3 | export default class ParsingError extends BaseError { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import './bootstrap/webpackPublicPath' 2 | import './bootstrap/plugins' 3 | import JSXC from './api/' 4 | 5 | export = JSXC 6 | -------------------------------------------------------------------------------- /example/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/git-it/jsxc/master/example/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/connection/FormItemField.ts: -------------------------------------------------------------------------------- 1 | import FormField from './FormField'; 2 | 3 | export default class FormItemField extends FormField { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/errors/ConnectionError.ts: -------------------------------------------------------------------------------- 1 | import BaseError from './BaseError' 2 | 3 | export default class ConnectionError extends BaseError { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/Avatar.interface.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface IAvatar { 3 | getData(): string 4 | 5 | getType(): string 6 | 7 | getHash(): string 8 | } 9 | -------------------------------------------------------------------------------- /src/connection/FormReportedField.ts: -------------------------------------------------------------------------------- 1 | import FormField from './FormField'; 2 | 3 | export default class FormReportedField extends FormField { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/errors/AuthenticationError.ts: -------------------------------------------------------------------------------- 1 | import BaseError from './BaseError' 2 | 3 | export default class AuthenticationError extends BaseError { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/errors/InvalidParameterError.ts: -------------------------------------------------------------------------------- 1 | import BaseError from './BaseError' 2 | 3 | export default class InvalidParameterError extends BaseError { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /scss/modules/_all.scss: -------------------------------------------------------------------------------- 1 | @import "colors"; 2 | @import "animation"; 3 | @import "muc"; 4 | @import "webrtc"; 5 | @import "presence"; 6 | @import "scrollbar"; 7 | -------------------------------------------------------------------------------- /scss/modules/_muc.scss: -------------------------------------------------------------------------------- 1 | %muc-avatar-icon { 2 | background-image: url("../images/group_white.svg"); 3 | background-size: 1em; 4 | text-indent: 999px; 5 | } 6 | -------------------------------------------------------------------------------- /images/menu_black.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/camera_icon_black.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/menu_white.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/camera_icon_grey.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /template/notification.hbs: -------------------------------------------------------------------------------- 1 |
{{{breaklines message}}}
4 | 5 | {{#if from}} 6 | 7 | {{/if}} 8 | -------------------------------------------------------------------------------- /src/plugins/chatState/State.ts: -------------------------------------------------------------------------------- 1 | export enum STATE { 2 | ACTIVE = 'active', 3 | COMPOSING = 'composing', 4 | PAUSED = 'paused', 5 | INACTIVE = 'inactive', 6 | GONE = 'gone' 7 | }; 8 | -------------------------------------------------------------------------------- /images/bookmark_black.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/bookmark_white.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scss/modules/_webrtc.scss: -------------------------------------------------------------------------------- 1 | %fullscreen { 2 | background-color: $fullscreen-bg; 3 | height: 100%; 4 | left: 0; 5 | position: absolute; 6 | top: 0; 7 | width: 100%; 8 | z-index: 9000; 9 | } 10 | -------------------------------------------------------------------------------- /.lgtm.yml: -------------------------------------------------------------------------------- 1 | extraction: 2 | javascript: 3 | index: 4 | exclude: 5 | - "build/" 6 | - "lib/" 7 | filters: 8 | - exclude: "src/jsxc.intro.js" 9 | - exclude: "src/jsxc.outro.js" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.zip 3 | *.zip.sig 4 | bower_components 5 | archives/ 6 | /css/ 7 | dev/ 8 | .wti 9 | *~ 10 | /tmp/ 11 | .idea 12 | /bundle.js 13 | /dist/ 14 | yarn-error.log 15 | .stylelintcache 16 | .env 17 | -------------------------------------------------------------------------------- /src/plugins/omemo/model/RegistrationId.ts: -------------------------------------------------------------------------------- 1 | 2 | export default class RegistrationId { 3 | constructor(private id: number) { 4 | 5 | } 6 | 7 | public getId(): number { 8 | return this.id; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /images/camera_icon_white.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/edit_black.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/fullscreen_black.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/omemo/util/Formatter.ts: -------------------------------------------------------------------------------- 1 | 2 | export default { 3 | toReadableKey: (key: ArrayBuffer) => { 4 | return ({{{question}}}
4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /template/helpers/breaklines.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | var Handlebars = require('handlebars-runtime'); 3 | 4 | module.exports = function(text) { 5 | text = Handlebars.Utils.escapeExpression(text); 6 | text = text.replace(/(\r\n|\n|\r)/gm, '{{t "omemo-device-list-explanation"}}
4 | 5 |{{t "OMEMO_peer_devices"}}
6 |{{t "OMEMO_own_devices"}}
9 |{{{breaklines message}}}
7 | {{/if}} 8 | 9 | {{#if hasPrimary}} 10 | 17 | {{/if}} 18 | 19 | {{#if hasOption}} 20 | 27 | {{/if}} 28 | -------------------------------------------------------------------------------- /src/plugins/omemo/model/EncryptedDeviceMessage.ts: -------------------------------------------------------------------------------- 1 | import Address from '../vendor/Address'; 2 | 3 | export interface ICiphertext { 4 | type: number, 5 | body: string, 6 | registrationId: number, 7 | } 8 | 9 | export default class { 10 | constructor(private address: Address, private ciphertext: ICiphertext) { 11 | 12 | } 13 | 14 | public getDeviceId(): number { 15 | return this.address.getDeviceId(); 16 | } 17 | 18 | public isPreKey(): boolean { 19 | return this.ciphertext.type === 3; 20 | } 21 | 22 | public getCiphertext(): ICiphertext { 23 | return this.ciphertext; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /images/filetypes/package-x-generic.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /template/fingerprints.hbs: -------------------------------------------------------------------------------- 1 |{{t "A_fingerprint_"}}
3 |
4 | {{t "Your_fingerprint"}}
5 |
6 | {{#if ownFingerprint}}
7 | {{ownFingerprint}}
8 | {{else}}
9 | {{t "not_available"}}
10 | {{/if}}
11 |
13 |
14 |
15 | {{#if theirFingerprint}}
16 | {{theirFingerprint}}
17 | {{else}}
18 | {{t "not_available"}}
19 | {{/if}}
20 |
');
33 |
34 | cellElement.text(column);
35 |
36 | cellElement.appendTo(rowElement);
37 | }
38 |
39 | rowElement[position](this.tableElement);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/template/about.hbs:
--------------------------------------------------------------------------------
1 | JavaScript XMPP Chat2 |
3 | Version: {{version}} 8 | Released under the MIT license 9 | 10 |11 | Real-time chat app for {{appName}} and more. 12 | 13 |14 | {{t "Credits"}}: David English (Ringtone), 15 | CameronMusic (Ping), 16 | Picol (Fullscreen icon), Jabber Software Foundation (Jabber lightbulb logo) 17 | 18 |19 | {{t "Libraries"}}: 20 | {{dependencies}} 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /template/multiUserInvite.hbs: -------------------------------------------------------------------------------- 1 |{{t "Invite_user"}}2 |{{t "muc_invite_explanation"}} 3 | 23 | -------------------------------------------------------------------------------- /images/download_icon_black.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSeverity": "error", 3 | "extends": [ 4 | "tslint:recommended" 5 | ], 6 | "jsRules": {}, 7 | "rules": { 8 | "quotemark": [true, "single"], 9 | "prefer-const": false, 10 | "trailing-comma": false, 11 | "semicolon": false, 12 | "ordered-imports": false, 13 | "member-ordering": false, 14 | "arrow-parens": false, 15 | "no-angle-bracket-type-assertion": false, 16 | "comment-format": false, 17 | "max-line-length": false, 18 | "only-arrow-functions": false, 19 | "unified-signatures": false, 20 | "interface-name": true, 21 | "object-literal-sort-keys": false, 22 | "max-classes-per-file": false, 23 | "no-console": false, 24 | "no-bitwise": false, 25 | "no-shadowed-variable": false, 26 | "no-var-requires": false, 27 | "no-unused-expression": [true, "allow-new"], 28 | "forin": false, 29 | "no-empty": false, 30 | "ban-types": false 31 | }, 32 | "rulesDirectory": [] 33 | } 34 | -------------------------------------------------------------------------------- /images/download_icon_white.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/omemo/vendor/SignalStore.interface.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface IIdentityKeyPair { privKey?: ArrayBuffer, pubKey: ArrayBuffer } 3 | export interface IPreKeyPair { pubKey, privKey } 4 | export interface ISignedPreKeyPair { signature, pubKey, privKey } 5 | 6 | interface ISignalStore { 7 | Direction: { SENDING: number, RECEIVING: number } 8 | 9 | getIdentityKeyPair(): Promise');
20 | this.element.addClass('jsxc-page');
21 |
22 | let legendElement = $(' ');
23 | legendElement.addClass('jsxc-page__headline')
24 | legendElement.text(this.title);
25 |
26 | if (this.navigation.canGoBack()) {
27 | legendElement.addClass('jsxc-clickable'); //@REVIEW
28 | legendElement.on('click', () => {
29 | this.navigation.goBack();
30 | });
31 | }
32 |
33 | legendElement.appendTo(this.element);
34 |
35 | this.element.append(this.generateContentElement());
36 | }
37 |
38 | protected abstract generateContentElement(): JQuery | JQuery[]
39 | }
40 |
--------------------------------------------------------------------------------
/src/LinkHandlerGeo.ts:
--------------------------------------------------------------------------------
1 | import { ILinkHandler } from './LinkHandler.interface';
2 | import Location from '@util/Location';
3 |
4 | export default class LinkHandlerGeo implements ILinkHandler {
5 | private static instance: LinkHandlerGeo;
6 |
7 | public static get(): LinkHandlerGeo {
8 | if (!LinkHandlerGeo.instance) {
9 | LinkHandlerGeo.instance = new LinkHandlerGeo();
10 | }
11 |
12 | return LinkHandlerGeo.instance;
13 | }
14 |
15 | public detect(element: JQuery) {
16 | element.find('[href^="geo:"]').each(function() {
17 | let uri = $(this).attr('href');
18 | let coords = Location.parseGeoUri(uri);
19 | let link = Location.locationToLink(coords.latitude, coords.longitude);
20 | let label = 'OSM: ' + Location.ddToDms(coords.latitude, coords.longitude);
21 |
22 | if (coords.accuracy) {
23 | label += ' (±' + (Math.round(coords.accuracy * 10) / 10) + 'm)';
24 | }
25 |
26 | $(this).attr('href', link);
27 | $(this).text(label);
28 | $(this).addClass('jsxc-geo');
29 | })
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/CONST.ts:
--------------------------------------------------------------------------------
1 | import incomingMessageSoundFile from '../sound/incomingMessage.mp3';
2 | import incomingCallSoundFile from '../sound/Rotary-Phone6.mp3';
3 | import noticeSoundFile from '../sound/Ping1.mp3';
4 |
5 | export let NOTIFICATION_DEFAULT = 'default';
6 | export let NOTIFICATION_GRANTED = 'granted';
7 | export let NOTIFICATION_DENIED = 'denied';
8 | export let STATUS = ['offline', 'dnd', 'xa', 'away', 'chat', 'online'];
9 | export let SOUNDS = {
10 | MSG: {{t "muc_invitation"}}2 |{{t "muc_invitation_explanation"}} 3 | 29 | -------------------------------------------------------------------------------- /images/smiley.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/api/index.ts: -------------------------------------------------------------------------------- 1 | import { testBOSHServer } from './v1/testBOSHServer'; 2 | import Client from '../Client'; 3 | import * as v1 from './v1' 4 | import { AbstractPlugin } from '@src/plugin/AbstractPlugin'; 5 | import { EncryptionPlugin } from '@src/plugin/EncryptionPlugin'; 6 | 7 | export default class JSXC { 8 | public static readonly version = __VERSION__; 9 | 10 | public static readonly testBOSHServer = testBOSHServer; 11 | 12 | public static readonly register = v1.register; 13 | 14 | public static readonly AbstractPlugin = AbstractPlugin; 15 | 16 | public static readonly AbstractEncryptionPlugin = EncryptionPlugin; 17 | 18 | public static readonly jQuery = $; 19 | 20 | private static initialized = false; 21 | 22 | public numberOfCachedAccounts: number; 23 | 24 | public version: string = __VERSION__; 25 | 26 | constructor(options) { 27 | if (JSXC.initialized) { 28 | throw new Error('JSXC was already initialized'); 29 | } 30 | 31 | JSXC.initialized = true; 32 | 33 | this.numberOfCachedAccounts = Client.init(options); 34 | 35 | Object.assign(this, v1); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Expected behavior 11 | 12 | ### Actual behavior 13 | 14 | ### Steps to reproduce the behavior 15 | 1. 16 | 2. 17 | 3. 18 | 19 | ### Environment 20 | - **JSXC version:** 21 | - **Host system and version:** 22 | - **Browser vendor and version:** 23 | - **Any browser plugins enabled?** 24 | - **XMPP server vendor and version:** 25 | - **Is your XMPP server working with other clients as expected?** 26 | 27 | ### Logs 28 | #### Javascript 29 | 30 | ``` 31 | ``` 32 | 33 | #### JSXC 34 | 35 | 36 | ``` 37 | ``` 38 | 39 | #### XMPP 40 | 41 | ``` 42 | ``` 43 | 44 | #### Host 45 | 46 | ``` 47 | ``` 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Klaus Herberth
2 |
25 |
--------------------------------------------------------------------------------
/example/css/example.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 30px;
3 | }
4 |
5 | .logout {
6 | display: none;
7 | }
8 |
9 | .jsxc-org, .localhost {
10 | display: none;
11 | }
12 |
13 | #content form .alert {
14 | display: none;
15 | }
16 |
17 | #content h3 {
18 | border-bottom: 1px solid #e5e5e5;
19 | margin-bottom: 20px;
20 | }
21 |
22 | #content .col-md-4 .form {
23 | min-height: 180px;
24 | }
25 |
26 | #content .row:first-child {
27 | margin-bottom: 30px;
28 | }
29 |
30 | #content .col-md-4>p {
31 | margin-bottom: 30px;
32 | }
33 |
34 | #server-flash {
35 | margin: 0;
36 | margin-top: 10px;
37 | }
38 |
39 | #server-flash:before {
40 | content: "\e031";
41 | position: relative;
42 | top: 1px;
43 | padding-right: 5px;
44 | display: inline-block;
45 | font-family: 'Glyphicons Halflings';
46 | font-style: normal;
47 | font-weight: 400;
48 | line-height: 1;
49 | -webkit-font-smoothing: antialiased;
50 | }
51 |
52 | #server-flash.success:before {
53 | content: "\e089";
54 | color: green;
55 | }
56 |
57 | #server-flash.fail:before {
58 | content: "\e088";
59 | color: red;
60 | }
61 |
62 | details {
63 | padding: 1em;
64 | margin-bottom: 1em;
65 | }
66 |
67 | summary {
68 | margin: -1em -1em 1em -1em;
69 | cursor: pointer;
70 | }
71 |
72 | body {
73 | border-top: 5px solid transparent;
74 | }
75 |
76 | body.jsxc-master {
77 | border-top: 5px solid green;
78 | }
79 |
80 | body.jsxc-slave {
81 | border-top: 5px solid orange;
82 | }
83 |
--------------------------------------------------------------------------------
/src/plugins/bookmarks/services/LocalService.ts:
--------------------------------------------------------------------------------
1 | import AbstractService from './AbstractService';
2 | import RoomBookmark from '../RoomBookmark';
3 | import IStorage from '@src/Storage.interface';
4 | import JID from '@src/JID';
5 | import { IJID } from '@src/JID.interface';
6 |
7 | export default class LocalService extends AbstractService {
8 | constructor(private storage: IStorage) {
9 | super();
10 | }
11 |
12 | public getName(): string {
13 | return 'local';
14 | }
15 |
16 | public async getRooms(): Promise
3 |
5 |
6 |
23 |
24 | ');
32 | textElement.addClass('jsxc-list__text');
33 | textElement.appendTo(this.element);
34 |
35 | $(' ').text(this.primaryText).addClass('jsxc-list__text__primary').appendTo(textElement);
36 |
37 | if (this.secondaryText) {
38 | $(' ').text(this.secondaryText).addClass('jsxc-list__text__secondary').appendTo(textElement);
39 | }
40 |
41 | if (this.secondaryAction) {
42 | this.secondaryAction.addClass('jsxc-list__secondary-action');
43 | this.element.append(this.secondaryAction);
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/template/loginBox.hbs:
--------------------------------------------------------------------------------
1 | {{t "Login"}}2 | 3 | 32 | -------------------------------------------------------------------------------- /images/padlock_open_disabled_black.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /template/contact.hbs: -------------------------------------------------------------------------------- 1 |{{t "Add_buddy"}}2 | 3 |{{t "Type_in_the_full_username_"}} 4 | 5 | 38 | -------------------------------------------------------------------------------- /src/plugins/bookmarks/BookmarksPlugin.ts: -------------------------------------------------------------------------------- 1 | import { AbstractPlugin, IMetaData } from '../../plugin/AbstractPlugin' 2 | import PluginAPI from '../../plugin/PluginAPI' 3 | import { PubSubService } from './services/PubSubService'; 4 | import LocalService from './services/LocalService'; 5 | import BookmarkProvider from './BookmarkProvider'; 6 | import Translation from '@util/Translation'; 7 | 8 | const MIN_VERSION = '4.0.0'; 9 | const MAX_VERSION = '99.0.0'; 10 | 11 | export default class BookmarksPlugin extends AbstractPlugin { 12 | public static getId(): string { 13 | return 'bookmarks'; 14 | } 15 | 16 | public static getName(): string { 17 | return 'Bookmarks'; 18 | } 19 | 20 | public static getMetaData(): IMetaData { 21 | return { 22 | description: Translation.t('setting-bookmarks-enable'), 23 | xeps: [{ 24 | id: 'XEP-0048', 25 | name: 'Bookmarks', 26 | version: '1.1', 27 | }] 28 | } 29 | } 30 | 31 | constructor(pluginAPI: PluginAPI) { 32 | super(MIN_VERSION, MAX_VERSION, pluginAPI); 33 | 34 | let contactManager = pluginAPI.getContactManager(); 35 | let provider = new BookmarkProvider(contactManager, pluginAPI.createMultiUserContact.bind(pluginAPI)); 36 | 37 | provider.registerService(new LocalService(pluginAPI.getStorage())); 38 | 39 | //@TODO test if pubsub is available 40 | let pubSub = new PubSubService(pluginAPI.getConnection()); 41 | provider.registerService(pubSub); 42 | 43 | pluginAPI.registerContactProvider(provider); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/FallbackContactProvider.ts: -------------------------------------------------------------------------------- 1 | import ContactProvider from './ContactProvider'; 2 | import { IContact } from './Contact.interface'; 3 | import { IJID } from './JID.interface'; 4 | import Contact from './Contact'; 5 | import Account from './Account'; 6 | import MultiUserContact from './MultiUserContact'; 7 | import ContactManager from './ContactManager'; 8 | 9 | export const FALLBACK_ID = 'fallback'; 10 | 11 | export default class FallbackContactProvider extends ContactProvider { 12 | constructor(protected contactManager: ContactManager, private account: Account) { 13 | super(contactManager); 14 | } 15 | 16 | public getUid(): string { 17 | return FALLBACK_ID; 18 | } 19 | 20 | public load(): Promise
21 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/src/ui/dialogs/multiUserInvitation.ts:
--------------------------------------------------------------------------------
1 | import Dialog from '../Dialog'
2 | import MultiUserContact from '../../MultiUserContact'
3 | import JID from '../../JID'
4 | import Log from '../../util/Log'
5 | import Client from '../../Client'
6 |
7 | let multiUserInvitation = require('../../../template/multiUserInvitation.hbs');
8 |
9 | export default function(type: 'direct' | 'mediated', from: string, room: string, reason: string, password: string, accountId: string) {
10 | let fromJid = new JID(from);
11 | let roomJid = new JID(room);
12 | let content = multiUserInvitation({
13 | from,
14 | room,
15 | reason
16 | });
17 |
18 | let dialog = new Dialog(content);
19 | let dom = dialog.open();
20 | let account = Client.getAccountManager().getAccount(accountId);
21 |
22 | dom.find('form').on('submit', (ev) => {
23 | ev.preventDefault();
24 |
25 | let multiUserContact = Restricted Area simulated22 | 23 |This page simulates your protected area or your login target. 24 | 25 |
26 |
28 |
29 |
34 | You are not logged in! Maybe your password was wrong. Back 27 | |