2
0
mirror of https://github.com/ComradCollective/Comrad synced 2024-11-05 21:20:51 +00:00
This commit is contained in:
quadrismegistus 2020-09-15 16:07:15 +01:00
parent 5963209695
commit 2b3199371b
3 changed files with 15 additions and 6 deletions

View File

@ -583,7 +583,7 @@ class KomradeX(Caller):
### MEETING PEOLPE
def meet(self,name=None,pubkey=None):
def meet(self,name=None,pubkey=None,returning=False):
if not name and not pubkey:
return {'success':False,'status':'Meet whom?'}
@ -593,7 +593,8 @@ class KomradeX(Caller):
'pubkey':self.uri,
'meet_name':name,
'meet_pubkey':pubkey
'meet_pubkey':pubkey,
'returning':returning
}
# print('msg_to_op',msg_to_op)

View File

@ -533,6 +533,13 @@ from_komrade = {from_komrade}
meet_uri = b64enc(meet_pubkey)
meet_from_name = data.get('name')
meet_from_uri = data.get('pubkey')
returning = data.get('returning')
if returning:
txt=f'''Komrade @{meet_name} has agreed to make your acquaintance. Their public key is {meet_uri.decode()}.'''
else:
txt=f'''Komrade @{meet_name} would like to make your acquaintance. Their public key is {meet_uri.decode()}.'''
msg_from_op = Message(
msg_d = {
'to':meet_uri,
@ -551,7 +558,7 @@ from_komrade = {from_komrade}
'msg':{
'txt':f'''Komrade @{meet_name} would like to make your acquaintance. Their public key is {meet_uri.decode()}.''',
'txt':txt,
'type':'prompt',
'prompt_id':'addcontact',
'meet_name':meet_from_name,

View File

@ -155,10 +155,10 @@ class CLI(Logger):
# # meet?
# self.komrade.meet(name)
def meet(self,dat):
def meet(self,dat,returning=False):
if self.with_required_login():
name_or_pubkey = dat.strip().split()[0]
res = self.komrade.meet(name_or_pubkey)
res = self.komrade.meet(name_or_pubkey,returning=returning)
print('@Operator:',res)
@ -202,7 +202,8 @@ class CLI(Logger):
clear_screen()
print(f'@Operator: The public key of @{meet_name} has been saved as a QRcode to {fnfn}:\n{qrstr}')
if do_senduser:
print('working on it ...')
print('returning the invitation ...')
self.meet(meet_name,returning=True)
def prompt_msg(self,msg):
do = input(f'\n\n@Operator: Type "r" to reply, "d" to delete, or just hit Enter to continue.\n{self.komrade}: ')