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

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

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

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

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

@ -1,5 +1,4 @@
/* global
_,
textsecure,
libsignal,
window,
@ -218,17 +217,6 @@ OutgoingMessage.prototype = {
async transmitMessage(number, data, timestamp, ttl = 24 * 60 * 60 * 1000) {
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 {
// TODO: Make NUM_CONCURRENT_CONNECTIONS a global constant
const options = {
@ -489,15 +477,8 @@ OutgoingMessage.prototype = {
},
// Send a message to a private group or a session chat (one to one)
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
const promises = outgoingObjects.map(outgoingObject => async () => {
if (!outgoingObject) {
return;
}
@ -533,20 +514,7 @@ OutgoingMessage.prototype = {
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.numberCompleted();
},
async buildAndEncrypt(devicePubKey) {

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

Loading…
Cancel
Save