Skip to content

Commit

Permalink
Add cmd user interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcardeenas committed Apr 10, 2020
1 parent c23e7b4 commit 7eba90c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/controllers/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Browser, Page } from 'puppeteer';
import puppeteer from 'puppeteer-extra';
import { CreateConfig } from '../config/create-config';
import { puppeteerConfig } from '../config/puppeteer.config';
import chalk = require('chalk');
import StealthPlugin = require('puppeteer-extra-plugin-stealth');

export async function initWhatsapp(session: string, options: CreateConfig) {
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import boxen = require('boxen');
import Spinnies = require('spinnies');
const { version } = require('../../package.json');

// Global
let updatesChecked = false;

/**
Expand Down Expand Up @@ -54,7 +55,7 @@ export async function create(
}

if (mergedOptions.logQR) {
console.log(`Scan QR for: ${session}`);
console.log(`Scan QR for: ${session} `);
console.log(asciiQR);
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/wapi/functions/delete-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* @param {Function} done Optional callback
*/
export function deleteMessages(chatId, messageArray, onlyLocal, done) {
var userId = new Store.WidFactory.createWid(chatId);
let conversation = WAPI.getChat(userId);
const userId = new Store.WidFactory.createWid(chatId);
const conversation = WAPI.getChat(userId);
if (!conversation) {
if (done !== undefined) {
done(false);
Expand Down
1 change: 1 addition & 0 deletions src/lib/wapi/functions/open-chat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function openChat(chatId) {}
5 changes: 5 additions & 0 deletions src/lib/wapi/store/store-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,9 @@ export const storeObjects = [
conditions: (module) =>
module.default && module.default.encryptAndUpload ? module.default : null,
},
{
id: 'Cmd',
conditions: (module) =>
module.default && module.default.openChatFromUnread ? module : null,
},
];
4 changes: 2 additions & 2 deletions src/lib/wapi/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const path = require('path');

module.exports = {
entry: './wapi.js',
// mode: 'development',
// devtool: 'source-map',
mode: 'development',
devtool: 'source-map',
output: {
path: path.resolve(__dirname, '../../../dist/lib/wapi'),
filename: 'wapi.js',
Expand Down

0 comments on commit 7eba90c

Please sign in to comment.