Fix an issue with notifcations

This commit is contained in:
stom79 2018-10-24 15:19:33 +02:00
parent db80fcf6b4
commit 9ffe0fe963
6 changed files with 10 additions and 6 deletions

View File

@ -7,8 +7,8 @@ android {
applicationId "fr.gouv.etalab.mastodon"
minSdkVersion 15
targetSdkVersion 28
versionCode 161
versionName "1.17.5"
versionCode 162
versionName "1.17.6"
}
flavorDimensions "default"
buildTypes {

View File

@ -1592,7 +1592,6 @@ public abstract class BaseMainActivity extends BaseActivity
b.putString("accountId", extras.getString(INTENT_TARGETED_ACCOUNT));
intentShow.putExtras(b);
startActivity(intentShow);
}
}else if( extras.getInt(INTENT_ACTION) == SEARCH_INSTANCE){
String instance = extras.getString(INSTANCE_NAME);

View File

@ -241,7 +241,7 @@ public class NotificationsSyncJob extends Job {
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK );
intent.putExtra(INTENT_ACTION, NOTIFICATION_INTENT);
intent.putExtra(PREF_KEY_ID, account.getId());
if( targeted_account != null )
if( targeted_account != null && notifType == Helper.NotifType.FOLLLOW)
intent.putExtra(INTENT_TARGETED_ACCOUNT, targeted_account);
intent.putExtra(PREF_INSTANCE, account.getInstance());
long notif_id = Long.parseLong(account.getId());

View File

@ -275,8 +275,9 @@ public class LiveNotificationService extends Service implements NetworkStateRece
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(INTENT_ACTION, NOTIFICATION_INTENT);
intent.putExtra(PREF_KEY_ID, account.getId());
if (targeted_account != null)
if (targeted_account != null) {
intent.putExtra(INTENT_TARGETED_ACCOUNT, targeted_account);
}
long notif_id = Long.parseLong(account.getId());
final int notificationId = ((notif_id + 1) > 2147483647) ? (int) (2147483647 - notif_id - 1) : (int) (notif_id + 1);
if (notification.getAccount().getAvatar() != null) {

View File

@ -117,6 +117,7 @@
android:id="@+id/toot_cw"
android:padding="5dp"
android:text="@string/cw"
android:layout_gravity="center"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="50dp"
android:layout_height="50dp" />
@ -124,12 +125,14 @@
android:id="@+id/toot_emoji"
android:minHeight="0dp"
android:minWidth="0dp"
android:layout_gravity="center"
android:padding="2dp"
android:scaleType="fitXY"
android:src="@drawable/emoji_one_category_smileysandpeople"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="30dp"
android:layout_height="30dp"
/>
/>
<TextView
android:id="@+id/toot_space_left"
android:layout_width="0dp"

View File

@ -118,6 +118,7 @@
android:id="@+id/toot_cw"
android:padding="5dp"
android:text="@string/cw"
android:layout_gravity="center"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="40dp"
android:layout_height="40dp" />