This repository was archived by the owner on Jul 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
app/src/main/java/com/zulip/android Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 141
141
import retrofit2 .Call ;
142
142
import retrofit2 .Response ;
143
143
144
+ import static com .zulip .android .util .Constants .ACTION_MESSAGE_PUSH_NOTIFICATION ;
144
145
import static com .zulip .android .util .Constants .REQUEST_PICK_FILE ;
145
146
146
147
/**
@@ -879,6 +880,9 @@ protected void onNewIntent(Intent intent) {
879
880
// Handle single file being sent
880
881
handleSentFile ((Uri ) intent .getParcelableExtra (Intent .EXTRA_STREAM ));
881
882
}
883
+ } else if (ACTION_MESSAGE_PUSH_NOTIFICATION .equals (action )) {
884
+ // Here, this condition can be used if some data has to be passed from the message push notification
885
+ return ; // We don't want to do with the data right so, do this return and skip the other check
882
886
}
883
887
884
888
// extract file path of edited image
Original file line number Diff line number Diff line change 18
18
import java .io .IOException ;
19
19
import java .net .URL ;
20
20
21
+ import static com .zulip .android .util .Constants .ACTION_MESSAGE_PUSH_NOTIFICATION ;
22
+
21
23
/**
22
24
* This {@code IntentService} does the actual handling of the GCM message.
23
25
* {@code GcmBroadcastReceiver} (a {@code WakefulBroadcastReceiver}) holds a
@@ -48,7 +50,7 @@ private void sendNotification(Bundle msg) {
48
50
.getSystemService (Context .NOTIFICATION_SERVICE );
49
51
50
52
PendingIntent contentIntent = PendingIntent .getActivity (this , 0 ,
51
- new Intent (this , ZulipActivity .class ).addFlags (0 ), 0 );
53
+ new Intent (this , ZulipActivity .class ).addFlags (0 ). setAction ( ACTION_MESSAGE_PUSH_NOTIFICATION ) , 0 );
52
54
53
55
String type = msg .getString ("recipient_type" );
54
56
String tag = "zulip" ;
Original file line number Diff line number Diff line change @@ -26,4 +26,5 @@ public class Constants {
26
26
public static String END_POINT_REGISTER = "register" ;
27
27
//if two continuous messages are from same sender and time difference is less than this then hide it
28
28
public static long HIDE_TIMESTAMP_THRESHOLD = 60 * 1000 ;// 1 minute
29
+ public static String ACTION_MESSAGE_PUSH_NOTIFICATION = "ACTION_MESSAGE_PUSH_NOTIFICATION" ;
29
30
}
You can’t perform that action at this time.
0 commit comments