Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message reply based on contacts #316

Merged
merged 4 commits into from
Jun 8, 2021
Merged

Add message reply based on contacts #316

merged 4 commits into from
Jun 8, 2021

Conversation

hegocre
Copy link
Collaborator

@hegocre hegocre commented Jun 7, 2021

Implemented the ability to choose which contacts to reply.

This needs testing, but looks like it's working for me.

It's only an initial approach, interface could be changed to something nicer and some code might need to be moved to more appropriate places.

@adeekshith adeekshith linked an issue Jun 7, 2021 that may be closed by this pull request
@adeekshith
Copy link
Owner

Looks great! Thank you @hegocre 😃
Yet to check the code but it is working for me.

Screenshots:

Screenshot_1623123784 Screenshot_1623123788
Screenshot_1623123792 Screenshot_1623123838

@hegocre
Copy link
Collaborator Author

hegocre commented Jun 8, 2021

Looks great!

That's nice!

Yet to check the code but it is working for me.

Let me know if there's something that needs to be changed!

@@ -40,6 +39,32 @@ private boolean canReply(StatusBarNotification sbn){
canSendReplyNow(sbn);
}

private boolean shouldReply(StatusBarNotification sbn){
PreferencesManager prefs = PreferencesManager.getPreferencesInstance(this);
boolean isGroup = sbn.getNotification().extras.getBoolean("android.isGroupConversation");
Copy link
Owner

@adeekshith adeekshith Jun 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is good except group detection. This should work ideally but there is an issue where images messages in WhatsApp group are not being tagged with isGroupConversation sometimes (#181).

So there is an extra logic to detect that: src

May be we should move that logic to a separate method and reuse it.
Or I will merge this PR as is this evening and raise another one fixing this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using that logic, but didn't manage to do it right, so went the easy way as a temporary fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read the issue you mentioned, if we are gonna add a new option to do extra checks in settings, i think this should be changed on the new PR

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No probs 😊
I'll merge this PR in the evening (CST) as is and make that fix before I forget. Great work!! 🙌

Also, as you are already good with Kotlin, feel free to use that in the future (anything is fine though). I am planning to move this project to Kotlin in the near future anyways as it is getting difficult to stick to Java in the Android world.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read the issue you mentioned, if we are gonna add a new option to do extra checks in settings, i think this should be changed on the new PR

Yep, Had to do a hotfix for a previous release. As soon as that is done, will make a PR to fix this group issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No probs blush
I'll merge this PR in the evening (CST) as is and make that fix before I forget. Great work!! raised_hands

Sounds nice

Also, as you are already good with Kotlin, feel free to use that in the future (anything is fine though). I am planning to move this project to Kotlin in the near future anyways as it is getting difficult to stick to Java in the Android world.

Yay!

@adeekshith adeekshith merged commit bb099f6 into adeekshith:main Jun 8, 2021
@fikimaul
Copy link

fikimaul commented Jun 9, 2021

Nice work bro @adeekshith @hegocre 🚀🚀

@tiptoptom
Copy link

I think this is like a whitelist. What about adding also a blacklist feature?

@adeekshith
Copy link
Owner

adeekshith commented Jun 9, 2021

I think this is like a whitelist. What about adding also a blacklist feature?

It has both (screenshot)

@hegocre
Copy link
Collaborator Author

hegocre commented Jun 9, 2021

Yes, it has both, as @adeekshith commented

@OLLI-S
Copy link

OLLI-S commented Jun 20, 2021

When will that be available?
I have 1.19.1 and here the feature is not yet available.

@adeekshith
Copy link
Owner

When will that be available?
I have 1.19.1 and here the feature is not yet available.

Hi @OLLI-S
This should be available in a week. Already tagged and tested. Uploading to Google play today. Might take 2 to 4 days to get it approved and then a few more days to roll out to everyone.

@OLLI-S
Copy link

OLLI-S commented Jun 20, 2021

@adeekshith Thank you for the info

@adeekshith
Copy link
Owner

Uploaded to Google Play. It warns that users will have to manually update this as this requests a new Contacts permission. Just concerned about it a little I hope it should be okay 😕

Users that have the APK with version code 24 may need to accept the android.permission.READ_CONTACTS permission, which may result in them not upgrading to this version of the app.

@OLLI-S
Copy link

OLLI-S commented Jun 26, 2021

Update received some days ago...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request Feature Contact exclusion
5 participants