Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@converse/headless

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@converse/headless - npm Package Compare versions

Comparing version 8.0.0 to 8.0.1

dist/converse-headless.min.js

2

core.js

@@ -86,3 +86,3 @@ /**

_converse.VERSION_NAME = "v8.0.0";
_converse.VERSION_NAME = "v8.0.1";

@@ -89,0 +89,0 @@ Object.assign(_converse, Events);

{
"name": "@converse/headless",
"version": "8.0.0",
"version": "8.0.1",
"description": "Converse.js Headless build",

@@ -5,0 +5,0 @@ "author": "cmrd Senya <senya@riseup.net>",

/**
* @copyright 2020, the Converse.js contributors
* @copyright The Converse.js contributors
* @license Mozilla Public License (MPLv2)

@@ -18,2 +18,13 @@ * @description This is the core utilities module.

export function isEmptyMessage (attrs) {
if (attrs instanceof Model) {
attrs = attrs.attributes;
}
return !attrs['oob_url'] &&
!attrs['file'] &&
!(attrs['is_encrypted'] && attrs['plaintext']) &&
!attrs['message'];
}
/**

@@ -129,3 +140,3 @@ * The utils object

return attrs['retracted'] || // Retraction received *before* the message
!u.isEmptyMessage(attrs);
!isEmptyMessage(attrs);
}

@@ -137,41 +148,2 @@

u.isEmptyMessage = function (attrs) {
if (attrs instanceof Model) {
attrs = attrs.attributes;
}
return !attrs['oob_url'] &&
!attrs['file'] &&
!(attrs['is_encrypted'] && attrs['plaintext']) &&
!attrs['message'];
};
//TODO: Remove
u.isOnlyChatStateNotification = function (msg) {
if (msg instanceof Element) {
// See XEP-0085 Chat State Notification
return (msg.querySelector('body') === null) && (
(msg.querySelector('active') !== null) ||
(msg.querySelector('composing') !== null) ||
(msg.querySelector('inactive') !== null) ||
(msg.querySelector('paused') !== null) ||
(msg.querySelector('gone') !== null));
}
if (msg instanceof Model) {
msg = msg.attributes;
}
return msg['chat_state'] && u.isEmptyMessage(msg);
};
u.isOnlyMessageDeliveryReceipt = function (msg) {
if (msg instanceof Element) {
// See XEP-0184 Message Delivery Receipts
return (msg.querySelector('body') === null) &&
(msg.querySelector('received') !== null);
}
if (msg instanceof Model) {
msg = msg.attributes;
}
return msg['received'] && u.isEmptyMessage(msg);
};
u.isChatRoom = function (model) {

@@ -604,2 +576,4 @@ return model && (model.get('type') === 'chatroom');

export default u;
export default Object.assign({
isEmptyMessage
}, u);

@@ -9,3 +9,3 @@ import URI from 'urijs';

window.location.protocol === 'http:' ||
(window.location.protocol === 'https:' && ['http', 'aesgcm'].includes(uri_protocol))
(window.location.protocol === 'https:' && ['https', 'aesgcm'].includes(uri_protocol))
);

@@ -12,0 +12,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc