Skip to content

Commit

Permalink
fix to issue 0xf104a#39 Reply feature does not work properly
Browse files Browse the repository at this point in the history
Use provided link to the conversation instead of the object_id filed in the notification to extract the chatroom id.

background in the settings_activity.xml was removed to make the app in the main branch run.
  • Loading branch information
freeflyk committed Jan 9, 2023
1 parent ae94c83 commit 45c3d2d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ static private PendingIntent getReplyIntent(Context context, @NonNull JSONObject
intent.setAction(Config.NotificationEventAction);
intent.putExtra("notification_id", rawNotification.getInt("notification_id"));
intent.putExtra("notification_event", NOTIFICATION_EVENT_FASTREPLY);
intent.putExtra("talk_chatroom", rawNotification.getString("object_id"));
String[] link = rawNotification.getString("link").split("/"); // use provided link to extract talk chatroom id
intent.putExtra("talk_chatroom", link[link.length-1]);

return PendingIntent.getBroadcast(
context,
Expand Down Expand Up @@ -146,7 +147,7 @@ public NotificationCompat.Builder updateNotification(int id, NotificationCompat.
@Override
public void onNotificationEvent(NotificationEvent event, Intent intent, NotificationService service) {
if (event == NOTIFICATION_EVENT_FASTREPLY) {
final String chatroom = intent.getStringExtra("talk_chatroom");
final String chatroom = intent.getStringExtra("talk_chatroom"); // the string send by spreed is chatroomid/
final int notification_id = intent.getIntExtra("notification_id", -1);
if (notification_id < 0) {
Log.wtf(TAG, "Bad notification id: " + notification_id);
Expand Down

0 comments on commit 45c3d2d

Please sign in to comment.