Revert sending id

pull/390/head
Beaudan 6 years ago
parent 1400284a1d
commit f857744e88

@ -1411,7 +1411,6 @@
const { isError } = options; const { isError } = options;
let messageData = { let messageData = {
id: data.id,
source: data.source, source: data.source,
sourceDevice: data.sourceDevice, sourceDevice: data.sourceDevice,
sent_at: data.timestamp, sent_at: data.timestamp,

@ -1357,7 +1357,6 @@
options.messageType = message.get('type'); options.messageType = message.get('type');
if (this.isPublic()) { if (this.isPublic()) {
options.publicEndpoint = this.getEndpoint(); options.publicEndpoint = this.getEndpoint();
options.messageId = id;
} }
const groupNumbers = this.getRecipients(); const groupNumbers = this.getRecipients();

@ -2014,9 +2014,7 @@
} else { } else {
await conversation.onFriendRequestAccepted(); await conversation.onFriendRequestAccepted();
} }
// Force save if the message already has an id, used for public channels
const id = await window.Signal.Data.saveMessage(message.attributes, { const id = await window.Signal.Data.saveMessage(message.attributes, {
forceSave: !!message.id,
Message: Whisper.Message, Message: Whisper.Message,
}); });
message.set({ id }); message.set({ id });

@ -80,7 +80,6 @@ class LokiMessageAPI {
isPing = false, isPing = false,
numConnections = DEFAULT_CONNECTIONS, numConnections = DEFAULT_CONNECTIONS,
publicEndpoint = null, publicEndpoint = null,
messageId = null,
} = options; } = options;
// Data required to identify a message in a conversation // Data required to identify a message in a conversation
const messageEventData = { const messageEventData = {
@ -106,7 +105,6 @@ class LokiMessageAPI {
timestamp: messageTimeStamp, timestamp: messageTimeStamp,
from: displayName, from: displayName,
source: this.ourKey, source: this.ourKey,
id: messageId,
}, },
}, },
], ],

@ -161,14 +161,12 @@ class LokiPublicChannelAPI {
let timestamp = new Date(adnMessage.created_at).getTime(); let timestamp = new Date(adnMessage.created_at).getTime();
let from = adnMessage.user.username; let from = adnMessage.user.username;
let source; let source;
let id;
if (adnMessage.annotations.length) { if (adnMessage.annotations.length) {
const noteValue = adnMessage.annotations[0].value; const noteValue = adnMessage.annotations[0].value;
({ from, timestamp, source, id } = noteValue); ({ from, timestamp, source } = noteValue);
} }
const messageData = { const messageData = {
id,
friendRequest: false, friendRequest: false,
source, source,
sourceDevice: 1, sourceDevice: 1,

@ -50,12 +50,10 @@ function OutgoingMessage(
messageType, messageType,
isPing, isPing,
publicEndpoint, publicEndpoint,
messageId,
} = } =
options || {}; options || {};
this.numberInfo = numberInfo; this.numberInfo = numberInfo;
this.publicEndpoint = publicEndpoint; this.publicEndpoint = publicEndpoint;
this.messageId = messageId;
this.senderCertificate = senderCertificate; this.senderCertificate = senderCertificate;
this.online = online; this.online = online;
this.messageType = messageType || 'outgoing'; this.messageType = messageType || 'outgoing';
@ -205,7 +203,6 @@ OutgoingMessage.prototype = {
}; };
if (this.publicEndpoint) { if (this.publicEndpoint) {
options.publicEndpoint = this.publicEndpoint; options.publicEndpoint = this.publicEndpoint;
options.messageId = this.messageId;
} }
await lokiMessageAPI.sendMessage(pubKey, data, timestamp, ttl, options); await lokiMessageAPI.sendMessage(pubKey, data, timestamp, ttl, options);
} catch (e) { } catch (e) {

Loading…
Cancel
Save