Skip to content

Commit e485abf

Browse files
committed
Enable E2E enc by default, opt-out via -M
1 parent 75af998 commit e485abf

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

yowsup-cli

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ class DemosArgParser(YowArgParser):
205205
credentialsOpts.add_argument("-c", "--config", action="store",
206206
help = "Path to config file containing authentication info. For more info about config format use --help-config")
207207

208-
configGroup.add_argument("-m", "--moxie", action="store_true", help="Enable experimental support for the"
209-
" new WhatsApp encryption")
208+
configGroup.add_argument("-M", "--unmoxie", action="store_true", help="Disable E2E Encryption")
210209

211210
cmdopts = self.add_argument_group("Command line interface demo")
212211
cmdopts.add_argument('-y', '--yowsup', action = "store_true", help = "Start the Yowsup command line client")
@@ -224,9 +223,6 @@ class DemosArgParser(YowArgParser):
224223
def process(self):
225224
super(DemosArgParser, self).process()
226225

227-
if self.args["moxie"]:
228-
logger.warning("--moxie/-m is deprecated and will be removed soon as e2e encryption is now almost mandatory.")
229-
230226
if self.args["yowsup"]:
231227
self.startCmdline()
232228
elif self.args["echo"]:
@@ -255,7 +251,7 @@ class DemosArgParser(YowArgParser):
255251
if not credentials:
256252
print("Error: You must specify a configuration method")
257253
sys.exit(1)
258-
stack = cli.YowsupCliStack(credentials, self.args["moxie"])
254+
stack = cli.YowsupCliStack(credentials, not self.args["unmoxie"])
259255
stack.start()
260256

261257
def startEcho(self):
@@ -265,7 +261,7 @@ class DemosArgParser(YowArgParser):
265261
print("Error: You must specify a configuration method")
266262
sys.exit(1)
267263
try:
268-
stack = echoclient.YowsupEchoStack(credentials, self.args["moxie"])
264+
stack = echoclient.YowsupEchoStack(credentials, not self.args["unmoxie"])
269265
stack.start()
270266
except KeyboardInterrupt:
271267
print("\nYowsdown")
@@ -280,7 +276,7 @@ class DemosArgParser(YowArgParser):
280276

281277
try:
282278
stack = sendclient.YowsupSendStack(credentials, [([self.args["send"][0], self.args["send"][1]])],
283-
self.args["moxie"])
279+
not self.args["unmoxie"])
284280
stack.start()
285281
except KeyboardInterrupt:
286282
print("\nYowsdown")
@@ -293,7 +289,7 @@ class DemosArgParser(YowArgParser):
293289
print("Error: You must specify a configuration method")
294290
sys.exit(1)
295291
try:
296-
stack = contacts.YowsupSyncStack(credentials,self.args["sync"].split(','),self.args["moxie"])
292+
stack = contacts.YowsupSyncStack(credentials,self.args["sync"].split(','), not self.args["unmoxie"])
297293
stack.start()
298294
except KeyboardInterrupt:
299295
print("\nYowsdown")
@@ -326,4 +322,3 @@ if __name__ == "__main__":
326322
parser = modeDict[mode]()
327323
if not parser.process():
328324
parser.print_help()
329-

0 commit comments

Comments
 (0)