Skip to content

Commit

Permalink
build v3.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sualko committed Jul 5, 2018
1 parent 8bdd831 commit 9f342ec
Show file tree
Hide file tree
Showing 16 changed files with 139 additions and 99 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<name>JavaScript XMPP Chat</name>
<summary>Facebook-like chat</summary>
<description>Facebook-like chat with end-to-end encrypted conversation, video calls, multi-user rooms, XMPP and internal server backend.</description>
<version>3.4.0</version>
<version>3.4.1</version>
<licence>agpl</licence>
<author mail="[email protected]">Klaus Herberth</author>
<author>Tobia De Koninck</author>
Expand Down
7 changes: 6 additions & 1 deletion build/appinfo/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,12 @@ public static function convertToRealUID($providedUid) {

$backends = \OC::$server->getUserManager()->getBackends();
foreach ($backends as $backend) {
if ($backend->getBackendName() === $user->getBackendClassName()) {
if ($backend instanceof IUserBackend) {
$backendName = $backend->getBackendName();
} else {
$backendName = get_class($backend);
}
if ($backendName === $user->getBackendClassName()) {
if (method_exists($backend, 'loginName2UserName')) {
$uid = $backend->loginName2UserName($providedUid);
if ($uid !== false) {
Expand Down
2 changes: 1 addition & 1 deletion build/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<name>JavaScript XMPP Chat</name>
<summary>Facebook-like chat</summary>
<description>Facebook-like chat with end-to-end encrypted conversation, video calls, multi-user rooms, XMPP and internal server backend.</description>
<version>3.4.0</version>
<version>3.4.1</version>
<licence>agpl</licence>
<author mail="[email protected]">Klaus Herberth</author>
<author>Tobia De Koninck</author>
Expand Down
4 changes: 2 additions & 2 deletions build/css/jsxc.oc.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*!
* ojsxc v3.4.0 - 2018-05-23
* ojsxc v3.4.1 - 2018-07-05
*
* Copyright (c) 2018 Klaus Herberth <[email protected]> <br>
* Released under the MIT license
*
* Please see http://www.jsxc.org/
*
* @author Klaus Herberth <[email protected]>
* @version 3.4.0
* @version 3.4.1
* @license MIT
*/

Expand Down
4 changes: 2 additions & 2 deletions build/js/eof.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*!
* ojsxc v3.4.0 - 2018-05-23
* ojsxc v3.4.1 - 2018-07-05
*
* Copyright (c) 2018 Klaus Herberth <[email protected]> <br>
* Released under the MIT license
*
* Please see http://www.jsxc.org/
*
* @author Klaus Herberth <[email protected]>
* @version 3.4.0
* @version 3.4.1
* @license MIT
*/

Expand Down
39 changes: 28 additions & 11 deletions build/js/jsxc/css/jsxc.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
.mfp-arrow,
.mfp-preloader,
.mfp-counter {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
Expand Down Expand Up @@ -1113,6 +1114,7 @@ img.emojione {
font-size: 14px;
line-height: 1.428571429;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
Expand Down Expand Up @@ -2712,9 +2714,10 @@ fieldset[disabled]
line-height: 30px;
float: left;
cursor: pointer;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
#jsxc_windowListSB > div:hover {
background-color: #b3b2b2; }
#jsxc_windowListSB > .jsxc_disabled {
Expand Down Expand Up @@ -2909,6 +2912,9 @@ fieldset[disabled]
resize: none;
transition: height 0.5s;
font-size: 13px; }
.jsxc_window textarea::-webkit-input-placeholder {
color: #000;
opacity: 0.3; }
.jsxc_window textarea::-moz-placeholder {
color: #000;
opacity: 0.3; }
Expand Down Expand Up @@ -3518,15 +3524,17 @@ ul.jsxc_vCard {
cursor: pointer;
border: 1px solid transparent;
border-radius: 4px;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c; }

.jsxc_oneway .jsxc_avatar {
filter: grayscale(100%); }
-webkit-filter: grayscale(100%);
filter: grayscale(100%); }

img.jsxc_vCard {
float: right;
Expand Down Expand Up @@ -3558,9 +3566,10 @@ img.jsxc_vCard {
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
Expand Down Expand Up @@ -3593,7 +3602,8 @@ img.jsxc_vCard {
z-index: 110;
margin: 8px 2px 5px 10px;
right: 0;
filter: drop-shadow(0 0 5px rgba(150, 150, 150, 0.75));
-webkit-filter: drop-shadow(0 0 5px rgba(150, 150, 150, 0.75));
filter: drop-shadow(0 0 5px rgba(150, 150, 150, 0.75));
padding: 4px 12px;
padding-left: 5px; }
.jsxc_menu:after {
Expand Down Expand Up @@ -3927,6 +3937,11 @@ div:full-screen {
div:full-screen.jsxc_localvideo {
border: 1px solid #fff; }

div:-webkit-full-screen {
width: 100%;
height: 100%;
background-color: #000; }

div:-moz-full-screen {
width: 100%;
height: 100%;
Expand All @@ -3941,6 +3956,8 @@ div:fullscreen {
width: 100%;
height: 100%;
background-color: #000; }
div:-webkit-full-screen.jsxc_localvideo {
border: 1px solid #fff; }
div:-moz-full-screen.jsxc_localvideo {
border: 1px solid #fff; }
div:-ms-fullscreen.jsxc_localvideo {
Expand Down
158 changes: 88 additions & 70 deletions build/js/jsxc/jsxc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*!
* jsxc v3.4.0 - 2018-05-23
* jsxc v3.4.1 - 2018-07-05
*
* Copyright (c) 2018 Klaus Herberth <[email protected]> <br>
* Released under the MIT license
*
* Please see https://www.jsxc.org/
*
* @author Klaus Herberth <[email protected]>
* @version 3.4.0
* @version 3.4.1
* @license MIT
*/

Expand All @@ -25,7 +25,7 @@ var jsxc = null, RTC = null, RTCPeerconnection = null;
*/
jsxc = {
/** Version of jsxc */
version: '3.4.0',
version: '3.4.1',

/** True if i'm the master */
master: false,
Expand Down Expand Up @@ -95,7 +95,7 @@ jsxc = {
REGEX: {
JID: new RegExp('\\b[^"&\'\\/:<>@\\s]+@[\\w-_.]+\\b', 'ig'),
URL: new RegExp(/(https?:\/\/|www\.)[^\s<>'"]+/gi),
GEOURI: new RegExp(/geo:(\d+\.\d+),(\d+\.\d+)(,\d+\.\d+)?(;u=(\d+(\.\d+)?))?/),
GEOURI: new RegExp(/geo:(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)(?:,-?\d+(?:\.\d+)?)?(?:;crs=[\w-]+)?(?:;u=(\d+(?:\.\d+)?))?(?:;[\w-]+=(?:[\w-_.!~*'()]|%[\da-f][\da-f])+)*/)
},
NS: {
CARBONS: 'urn:xmpp:carbons:2',
Expand Down Expand Up @@ -2167,71 +2167,10 @@ jsxc.xmpp = {
}));
}

var attachment;
if (htmlBody.length === 1) {
var httpUploadElement = htmlBody.find('a[data-type][data-name][data-size]');

if (httpUploadElement.length === 1) {
// deprecated syntax @since 3.2.1
attachment = {
type: httpUploadElement.attr('data-type'),
name: httpUploadElement.attr('data-name'),
size: httpUploadElement.attr('data-size'),
};

if (httpUploadElement.attr('data-thumbnail') && httpUploadElement.attr('data-thumbnail').match(/^\s*data:[a-z]+\/[a-z0-9-+.*]+;base64,[a-z0-9=+/]+$/i)) {
attachment.thumbnail = httpUploadElement.attr('data-thumbnail');
}

if (httpUploadElement.attr('href') && httpUploadElement.attr('href').match(/^https:\/\//)) {
attachment.data = httpUploadElement.attr('href');
body = null;
}

if (!attachment.type.match(/^[a-z]+\/[a-z0-9-+.*]+$/i) || !attachment.name.match(/^[\s\w.,-]+$/i) || !attachment.size.match(/^\d+$/i)) {
attachment = undefined;

jsxc.warn('Invalid file type, name or size.');
}
} else if (htmlBody.find('>a').length === 1) {
var linkElement = htmlBody.find('>a');
var metaString = '';
var thumbnail;

if (linkElement.find('>img').length === 1) {
var imgElement = linkElement.find('>img');
var src = imgElement.attr('src') || '';
var altString = imgElement.attr('alt') || '';
metaString = altString.replace(/^Preview:/, '');

if (src.match(/^\s*data:[a-z]+\/[a-z0-9-+.*]+;base64,[a-z0-9=+/]+$/i)) {
thumbnail = src;
}
} else {
metaString = linkElement.text();
}

var metaMatch = metaString.match(/^([a-z]+\/[a-z0-9-+.*]+)\|(\d+)\|([\s\w.,-]+)/);
var attachment = jsxc.xmpp.getAttachmentFromHtmlBody(htmlBody);

if (metaMatch) {
attachment = {
type: metaMatch[1],
size: metaMatch[2],
name: metaMatch[3],
};

if (thumbnail) {
attachment.thumbnail = thumbnail;
}

if (linkElement.attr('href') && linkElement.attr('href').match(/^https?:\/\//)) {
attachment.data = linkElement.attr('href');
body = null;
}
} else {
jsxc.warn('Invalid file type, name or size.');
}
}
if (attachment) {
body = null;
}

if (jsxc.otr.objects.hasOwnProperty(bid) && body) {
Expand Down Expand Up @@ -2376,6 +2315,77 @@ jsxc.xmpp = {
jsxc.storage.setItem('rid', rid);
},

getAttachmentFromHtmlBody: function(htmlBody) {
if (htmlBody.length !== 1) {
return;
}

var attachment;
var httpUploadElement = htmlBody.find('a[data-type][data-name][data-size]');

if (httpUploadElement.length === 1) {
// deprecated syntax @since 3.2.1
attachment = {
type: httpUploadElement.attr('data-type'),
name: httpUploadElement.attr('data-name'),
size: httpUploadElement.attr('data-size'),
};

if (httpUploadElement.attr('data-thumbnail') && httpUploadElement.attr('data-thumbnail').match(/^\s*data:[a-z]+\/[a-z0-9-+.*]+;base64,[a-z0-9=+/]+$/i)) {
attachment.thumbnail = httpUploadElement.attr('data-thumbnail');
}

if (httpUploadElement.attr('href') && httpUploadElement.attr('href').match(/^https:\/\//)) {
attachment.data = httpUploadElement.attr('href');
}

if (!attachment.type.match(/^[a-z]+\/[a-z0-9-+.*]+$/i) || !attachment.name.match(/^[\s\w.,-]+$/i) || !attachment.size.match(/^\d+$/i)) {
attachment = undefined;

jsxc.warn('Invalid file type, name or size.');
}
} else if (htmlBody.find('>a').length === 1) {
var linkElement = htmlBody.find('>a');
var metaString = '';
var thumbnail;

if (linkElement.find('>img').length === 1) {
var imgElement = linkElement.find('>img');
var src = imgElement.attr('src') || '';
var altString = imgElement.attr('alt') || '';
metaString = altString.replace(/^Preview:/, '');

if (src.match(/^\s*data:[a-z]+\/[a-z0-9-+.*]+;base64,[a-z0-9=+/]+$/i)) {
thumbnail = src;
}
} else {
metaString = linkElement.text();
}

var metaMatch = metaString.match(/^([a-z]+\/[a-z0-9-+.*]+)\|(\d+)\|([\s\w.,-]+)/);

if (metaMatch) {
attachment = {
type: metaMatch[1],
size: metaMatch[2],
name: metaMatch[3],
};

if (thumbnail) {
attachment.thumbnail = thumbnail;
}

if (linkElement.attr('href') && linkElement.attr('href').match(/^https?:\/\//)) {
attachment.data = linkElement.attr('href');
}
} else {
jsxc.warn('Invalid file type, name or size.');
}
}

return attachment;
},

/**
* response to friendship request
*
Expand Down Expand Up @@ -4153,7 +4163,7 @@ jsxc.gui = {
var matches = $(this).attr('href').match(jsxc.CONST.REGEX.GEOURI);
var latitude = matches[1];
var longitude = matches[2];
var accuracy = matches[5];
var accuracy = matches[3];
var osmUrl = 'https://www.openstreetmap.org/?mlat=' + latitude + '&mlon=' + longitude + '#map=16/' + latitude + '/' + longitude;
var label = 'OSM: ' + ddToDms(latitude, longitude);

Expand Down Expand Up @@ -7992,6 +8002,7 @@ jsxc.muc = {
}

var from = $(message).attr('from');
var htmlBodyElement = $(message).find('body[xmlns="' + Strophe.NS.XHTML + '"]').first();
var body = $(message).find('body:first').text();
var room = jsxc.jidToBid(from);
var nickname = Strophe.unescapeNode(Strophe.getResourceFromJid(from));
Expand All @@ -8012,12 +8023,19 @@ jsxc.muc = {

jsxc.gui.window.init(room);

var attachment = jsxc.xmpp.getAttachmentFromHtmlBody(htmlBodyElement);

if (attachment) {
body = null;
}

jsxc.gui.window.postMessage({
bid: room,
direction: jsxc.Message.IN,
msg: body,
stamp: stamp,
sender: sender
sender: sender,
attachment: attachment
});
}

Expand Down
2 changes: 1 addition & 1 deletion build/js/jsxc/jsxc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/js/jsxc/jsxc.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 9f342ec

Please sign in to comment.