Update cache with actions
This commit is contained in:
parent
6a4f1e659f
commit
8a4f7f65a2
|
@ -2138,6 +2138,8 @@ public class API {
|
|||
Intent intentBC = new Intent(Helper.RECEIVE_ACTION);
|
||||
intentBC.putExtras(b);
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intentBC);
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
new TimelineCacheDAO(context, db).update(targetedId, resp);
|
||||
}
|
||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||
setError(e.getStatusCode(), e);
|
||||
|
@ -2153,6 +2155,8 @@ public class API {
|
|||
HttpsConnection httpsConnection = new HttpsConnection(context);
|
||||
httpsConnection.delete(getAbsoluteUrl(action), 60, null, prefKeyOauthTokenT);
|
||||
actionCode = httpsConnection.getActionCode();
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
new TimelineCacheDAO(context, db).remove(targetedId);
|
||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||
setError(e.getStatusCode(), e);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
|
|
|
@ -53,6 +53,7 @@ import app.fedilab.android.fragments.DisplayNotificationsFragment;
|
|||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TimelineCacheDAO;
|
||||
|
||||
import static app.fedilab.android.helper.Helper.PREF_KEY_OAUTH_TOKEN;
|
||||
|
||||
|
@ -1393,6 +1394,11 @@ public class GNUAPI {
|
|||
Intent intentBC = new Intent(Helper.RECEIVE_ACTION);
|
||||
intentBC.putExtras(b);
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intentBC);
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
new TimelineCacheDAO(context, db).update(targetedId, resp);
|
||||
}else if( statusAction == API.StatusAction.UNSTATUS){
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
new TimelineCacheDAO(context, db).remove(targetedId);
|
||||
}
|
||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||
setError(e.getStatusCode(), e);
|
||||
|
|
Loading…
Reference in New Issue