Add local smsg addresses if missing.

This commit is contained in:
tecnovert 2024-06-14 12:27:45 +02:00
parent d93a73c29e
commit 57f238d48e
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93

View file

@ -7553,9 +7553,11 @@ class BasicSwap(BaseApp):
use_session = self.openSession(session) use_session = self.openSession(session)
try: try:
mode = '-' if active_ind == 0 else '+' mode = '-' if active_ind == 0 else '+'
self.callrpc('smsglocalkeys', ['recv', mode, address]) rv = self.callrpc('smsglocalkeys', ['recv', mode, address])
if 'not found' in rv['result']:
self.callrpc('smsgaddlocaladdress', [address,])
self.callrpc('smsglocalkeys', ['anon', '-', address])
values = {'active_ind': active_ind, 'addr': address, 'use_type': use_type} values = {'active_ind': active_ind, 'addr': address, 'use_type': use_type}
query_str: str = 'UPDATE smsgaddresses SET active_ind = :active_ind' query_str: str = 'UPDATE smsgaddresses SET active_ind = :active_ind'
if addressnote is not None: if addressnote is not None:
values['note'] = addressnote values['note'] = addressnote