syncModels method

Future<bool> syncModels()

Implementation

Future<bool> syncModels() async {
  state = MockingbirdState.modelSyncing;
  await syncContact();
  await syncChannel();
  var channels = await db.query(
    Channel.stableName,
    columns: ["id"],
    where: "client_user_id = ?",
    whereArgs: [userId],
  );
  for (var ch in channels) {
    await syncMessage(ch["id"] as String);
    await syncMessageLike(ch["id"] as String);
    await syncMessageTag(ch["id"] as String);
  }
  state = MockingbirdState.modelSynced;
  return true;
}