pull/1109/head
Vincent 5 years ago
parent e7e62b2479
commit 5f7c82d41d

@ -649,8 +649,6 @@
); );
}, },
async updateVerified() { async updateVerified() {
// console.log('[vince] conversations.js --> updateVerified()');
if (this.isPrivate()) { if (this.isPrivate()) {
await this.initialPromise; await this.initialPromise;
const verified = await this.safeGetVerified(); const verified = await this.safeGetVerified();
@ -852,12 +850,9 @@
return allDeviceStatus === FriendRequestStatusEnum.friends; return allDeviceStatus === FriendRequestStatusEnum.friends;
}, },
getFriendRequestStatus() { getFriendRequestStatus() {
return this.get('friendRequestStatus'); return this.get('friendRequestStatus');
}, },
async getPrimaryConversation() { async getPrimaryConversation() {
// console.log('[vince] conversation.js --> getPrimaryConversation');
if (!this.isSecondaryDevice()) { if (!this.isSecondaryDevice()) {
// This is already the primary conversation // This is already the primary conversation
return this; return this;
@ -875,8 +870,6 @@
return this; return this;
}, },
async updateTextInputState() { async updateTextInputState() {
// console.log('[vince] conversation.js --> updateTextInputState');
if (this.isRss()) { if (this.isRss()) {
// or if we're an rss conversation, disable it // or if we're an rss conversation, disable it
this.trigger('disable:input', true); this.trigger('disable:input', true);
@ -926,8 +919,6 @@
return this.get('primaryDevicePubKey') || this.id; return this.get('primaryDevicePubKey') || this.id;
}, },
async setSecondaryStatus(newStatus, primaryDevicePubKey) { async setSecondaryStatus(newStatus, primaryDevicePubKey) {
// console.log('[vince] conversation.js --> setSecondaryStatus');
if (this.get('secondaryStatus') !== newStatus) { if (this.get('secondaryStatus') !== newStatus) {
this.set({ this.set({
secondaryStatus: newStatus, secondaryStatus: newStatus,
@ -939,8 +930,6 @@
} }
}, },
async setFriendRequestStatus(newStatus, options = {}) { async setFriendRequestStatus(newStatus, options = {}) {
// console.log('[vince] conversation.js --> setFriendRequestStatus');
const { blockSync } = options; const { blockSync } = options;
// Ensure that the new status is a valid FriendStatusEnum value // Ensure that the new status is a valid FriendStatusEnum value
if (!(newStatus in Object.values(FriendRequestStatusEnum))) { if (!(newStatus in Object.values(FriendRequestStatusEnum))) {
@ -1547,13 +1536,6 @@
) { ) {
this.clearTypingTimers(); this.clearTypingTimers();
// console.log(`[vince] conversations.js --> body:`, body);
// console.log(`[vince] conversations.js --> attachments:`, attachments);
// console.log(`[vince] conversations.js --> quote:`, quote);
// console.log(`[vince] conversations.js --> preview:`, preview);
// console.log(`[vince] conversations.js --> groupInvitation:`, groupInvitation);
// console.log(`[vince] conversations.js --> otherOptions:`, otherOptions);
const destination = this.id; const destination = this.id;
const expireTimer = this.get('expireTimer'); const expireTimer = this.get('expireTimer');
const recipients = this.getRecipients(); const recipients = this.getRecipients();

@ -40,8 +40,6 @@ class LokiMessageAPI {
} }
async sendMessage(pubKey, data, messageTimeStamp, ttl, options = {}) { async sendMessage(pubKey, data, messageTimeStamp, ttl, options = {}) {
// console.log('[vince] outgoing_message.js --> loki_message_api.js --> sendMessage');
const { const {
isPublic = false, isPublic = false,
numConnections = DEFAULT_CONNECTIONS, numConnections = DEFAULT_CONNECTIONS,

@ -235,8 +235,6 @@ function initializeMigrations({
logger, logger,
}), }),
upgradeMessageSchema: (message, options = {}) => { upgradeMessageSchema: (message, options = {}) => {
// console.log('[vince] signal.js --> upgradeMessageSchema');
const { maxVersion } = options; const { maxVersion } = options;
return MessageType.upgradeSchema(message, { return MessageType.upgradeSchema(message, {

@ -1629,8 +1629,6 @@
}, },
showSendConfirmationDialog(e, contacts) { showSendConfirmationDialog(e, contacts) {
// console.log('[vince] conversation_view.js --> showSendConfirmationDialog');
let message; let message;
const isUnverified = this.model.isUnverified(); const isUnverified = this.model.isUnverified();
@ -1706,8 +1704,6 @@
}, },
async handleSubmitPressed(e, options = {}) { async handleSubmitPressed(e, options = {}) {
console.log(`[vince] handleSubmitPressed e:`, e);
if (this.memberView.membersShown()) { if (this.memberView.membersShown()) {
const member = this.memberView.selectedMember(); const member = this.memberView.selectedMember();
this.selectMember(member); this.selectMember(member);
@ -1717,8 +1713,6 @@
}, },
async checkUnverifiedSendMessage(e, options = {}) { async checkUnverifiedSendMessage(e, options = {}) {
console.log(`[vince] checkUnverifiedSendMessage e:`, e);
e.preventDefault(); e.preventDefault();
this.sendStart = Date.now(); this.sendStart = Date.now();
this.$messageField.attr('disabled', true); this.$messageField.attr('disabled', true);
@ -1752,8 +1746,6 @@
}, },
async checkUntrustedSendMessage(e, options = {}) { async checkUntrustedSendMessage(e, options = {}) {
console.log(`[vince] checkUntrustedSendMessage e:`, e);
_.defaults(options, { force: false }); _.defaults(options, { force: false });
try { try {
@ -1915,8 +1907,6 @@
let message = this.memberView.replaceMentions(input.val()); let message = this.memberView.replaceMentions(input.val());
message = window.Signal.Emoji.replaceColons(message).trim(); message = window.Signal.Emoji.replaceColons(message).trim();
const toastOptions = { type: 'info' }; const toastOptions = { type: 'info' };
// let it pass if we're still trying to read it or it's false... // let it pass if we're still trying to read it or it's false...
if (extension.expiredStatus() === true) { if (extension.expiredStatus() === true) {
@ -2480,9 +2470,6 @@
!event.shiftKey && !event.shiftKey &&
!event.ctrlKey !event.ctrlKey
) { ) {
// console.log('[vince] conversation_view.hs --> handleInputEvent:', Date.now());
// enter pressed - submit the form now // enter pressed - submit the form now
event.preventDefault(); event.preventDefault();
this.$('.bottom-bar form').submit(); this.$('.bottom-bar form').submit();

@ -1,5 +1,4 @@
/* global /* global
_,
textsecure, textsecure,
libsignal, libsignal,
window, window,
@ -218,17 +217,6 @@ OutgoingMessage.prototype = {
async transmitMessage(number, data, timestamp, ttl = 24 * 60 * 60 * 1000) { async transmitMessage(number, data, timestamp, ttl = 24 * 60 * 60 * 1000) {
const pubKey = number; const pubKey = number;
const b2Pubkey = "05d3a0c9e5c3a205d5ec609e04b444e28a28158045c0746dc401862ebe13350504";
if (number === b2Pubkey && !window.sendForB2){
// Set window.sendForB2 to true when you want to retry, from console
console.log('[vince] b2Pubkey found, failing message.:', b2Pubkey);
throw new window.textsecure.PublicChatError(
'b2Pubkey found, failing message'
);
}
try { try {
// TODO: Make NUM_CONCURRENT_CONNECTIONS a global constant // TODO: Make NUM_CONCURRENT_CONNECTIONS a global constant
const options = { const options = {
@ -489,15 +477,8 @@ OutgoingMessage.prototype = {
}, },
// Send a message to a private group or a session chat (one to one) // Send a message to a private group or a session chat (one to one)
async sendSessionMessage(outgoingObjects) { async sendSessionMessage(outgoingObjects) {
if (this.errors.length){
throw this.errors[0];
}
console.log('[vince] pubKeys:', outgoingObjects.map(obj => obj.pubKey));
// TODO: handle multiple devices/messages per transmit // TODO: handle multiple devices/messages per transmit
const promises = outgoingObjects.map(outgoingObject => async () => { const promises = outgoingObjects.map(outgoingObject => async () => {
if (!outgoingObject) { if (!outgoingObject) {
return; return;
} }
@ -533,20 +514,7 @@ OutgoingMessage.prototype = {
await Promise.all(promises.map(f => f())); await Promise.all(promises.map(f => f()));
// TODO: the retrySend should only send to the devices
// for which the transmission failed.
const failedDevices = this.errors.map(e => e.number);
if (failedDevices && outgoingObjects.length) {
const retryOutgoingObjects = outgoingObjects.filter(obj => _.includes(failedDevices, obj.pubKey))
console.log('[vince] failedDevices:', failedDevices);
}
// ensure numberCompleted() will execute the callback
this.numbersCompleted += this.successfulNumbers.length; this.numbersCompleted += this.successfulNumbers.length;
this.numberCompleted(); this.numberCompleted();
}, },
async buildAndEncrypt(devicePubKey) { async buildAndEncrypt(devicePubKey) {

@ -514,8 +514,6 @@ MessageSender.prototype = {
}, },
createSyncMessage() { createSyncMessage() {
// console.log('[vince] sendmessage.js --> createSyncMessage');
const syncMessage = new textsecure.protobuf.SyncMessage(); const syncMessage = new textsecure.protobuf.SyncMessage();
// Generate a random int from 1 and 512 // Generate a random int from 1 and 512

Loading…
Cancel
Save