def Find_From_Address(self, Address): Identities = Contact_Client().Link_Address_To_PubKey( Address_To_Search=Address).Other_Identities if Identities[0] != "0" * 81: return Identities #Output = [PublicKey(string), known by other addresses(list)] else: return False
def Build_All_Directories(self): Initialization().Build_Application() Initialization().InboxGenerator() User_Profile() Inbox_Manager().Create_DB() Contact_Client().Build_ContactDB() Trusted_Paths().Build_LedgerDB() #Output = Nothing return self
def Read_Stored_Messages(self): Dictionary = self.Read_From_Json(directory=self.Message_Inbox) Saved_Messages = self.Dictionary_To_List(Dictionary=Dictionary) Data = [] for i in Saved_Messages: Message = self.Base64_To_String(Encoded=i[0]) From_Address = i[1] #Now check if the address is in the address book. Output = Contact_Client().Retrieve_UserName_From_Address( Address_To_Search=From_Address) if Output == False: User = From_Address elif isinstance(Output, list): User = str(Output[0] + " (" + From_Address + ")") Data.append([Message, User]) return Data
def Return_Contact_List(self): Contact_Names = Contact_Client().Saved_Contacts() #Output = [List of usernames] return Contact_Names
def Refresh_Contact_List(self): Contact_Client().Update_Contacts() #Output = Nothing return self
def Last_Seen_Address(self, PublicKey): Output = Contact_Client().Get_Current_Address_From_PublicKey( PublicKey=PublicKey) #Output: String if address included in current ledger, else 'None' is returned return Output
def Address_From_Username(self, Username): Output = Contact_Client().Username_To_Address(Username=Username) #Output: if contact present a list is returned [Public Key, Address], else 'None' is returned return Output
def Username_From_Address(self, Address): Output = Contact_Client().Retrieve_UserName_From_Address( Address_To_Search=Address) #if Address in contact list; --> Output = [Saved Username (string), PublicKey(string), Has the address been found? (Bool)] otherwise a simple False(bool) will be returned return Output
def Delete_From_Contacts(self, Username): Contact_Client().Delete_From_Contacts(User_Name=Username) #Output = Nothing return self
def Add_Address(self, Address, Username): Contact_Client().Link_Address_To_PubKey(Address_To_Search=Address, User_Name=Username) return self
def Find_From_PubKey(self, PublicKey): self.Identities = Contact_Client().Link_Address_To_PubKey( Public_Key_To_Search=PublicKey).Other_Identities #Output = [PublicKey(string), known by other addresses(list)] return self