예제 #1
0
// getAddgetAddressBookContactsFromContentHub gets the phone contacts via the content hub
func getAddressBookContactsFromContentHub() ([]textsecure.Contact, error) {
	if exists(contactsFile) && vcardPath == "" {
		return textsecure.ReadContacts(contactsFile)
	}
	vcardPath := strings.TrimPrefix(vcardPath, "file://")
	contacts, err := getContactsFromVCardFile(vcardPath)
	if err != nil {
		return nil, err
	}

	err = textsecure.WriteContacts(contactsFile, contacts)
	if err != nil {
		return nil, err
	}
	return contacts, nil
}
예제 #2
0
func getLocalContacts() ([]textsecure.Contact, error) {
	return textsecure.ReadContacts(configDir + "/contacts.yml")
}
예제 #3
0
// getDesktopContacts reads the contacts for the desktop app from a file
func getDesktopContacts() ([]textsecure.Contact, error) {
	return textsecure.ReadContacts(filepath.Join(configDir, "contacts.yml"))
}
예제 #4
0
// get contacts file, pass to the ts library
func getLocalContacts() ([]ts.Contact, error) {
	return ts.ReadContacts(".config/contacts.yml")
}