|
|
|
@ -263,8 +263,10 @@ class CLI(Logger):
|
|
|
|
|
self.stat(status)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def msg(self,dat):
|
|
|
|
|
def msg(self,dat='',name_or_pubkey=None,msg_s=None):
|
|
|
|
|
if self.with_required_login():
|
|
|
|
|
|
|
|
|
|
if not name_or_pubkey:
|
|
|
|
|
dat=dat.strip()
|
|
|
|
|
if not dat:
|
|
|
|
|
self.status('Message whom? Usage: /msg [name]')
|
|
|
|
@ -274,6 +276,8 @@ class CLI(Logger):
|
|
|
|
|
name_or_pubkey = datl[0]
|
|
|
|
|
if name_or_pubkey.startswith('@'):
|
|
|
|
|
name_or_pubkey=name_or_pubkey[1:]
|
|
|
|
|
|
|
|
|
|
if not msg_s:
|
|
|
|
|
if len(datl)==1:
|
|
|
|
|
print()
|
|
|
|
|
self.stat(f'Compose your message to @{name_or_pubkey} below.', 'Press Ctrl+D to complete, or Ctrl+C to cancel.')
|
|
|
|
@ -404,11 +408,10 @@ class CLI(Logger):
|
|
|
|
|
|
|
|
|
|
def post(self,msg_s):
|
|
|
|
|
if self.with_required_login():
|
|
|
|
|
res = self.komrade.post(msg_s)
|
|
|
|
|
self.stat(res['status'],komrade_name='Operator')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return self.msg(
|
|
|
|
|
name_or_pubkey=WORLD_NAME,
|
|
|
|
|
msg_s=msg_s
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|