Skip to content

Commit c597b46

Browse files
committed
Add send blue tick option to conversation menu
1 parent 6ef0687 commit c597b46

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

  • app/src/main/java/com/wmods/wppenhacer/xposed/features/general

app/src/main/java/com/wmods/wppenhacer/xposed/features/general/SeenTick.kt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,25 @@ class SeenTick(
337337
private fun hookConversationScreen(ticktype: Int) {
338338
val onCreateMenuConversationMethod = Unobfuscator.loadOnCreatedMenuConversation(classLoader)
339339

340+
341+
XposedBridge.hookMethod(onCreateMenuConversationMethod, object : XC_MethodHook() {
342+
override fun afterHookedMethod(param: MethodHookParam) {
343+
val menu = param.args[0] as Menu
344+
val menuItem = menu.add(0, 0, 0, R.string.send_blue_tick)
345+
if (ticktype == 1) menuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS)
346+
menuItem.setIcon(Utils.getID("ic_notif_mark_read", "drawable"))
347+
menuItem.setOnMenuItemClickListener {
348+
val currentUserJid = WppCore.getCurrentUserJid()
349+
currentUserJid?.let { jid -> sendBlueTick(jid) }
350+
Utils.showToast(
351+
Utils.getString(R.string.sending_read_blue_tick),
352+
Toast.LENGTH_SHORT
353+
)
354+
true
355+
}
356+
}
357+
})
358+
340359
MenuStatusListener.menuStatuses.add(object : MenuStatusListener.OnMenuItemStatusListener() {
341360
override fun addMenu(
342361
menu: Menu,

0 commit comments

Comments
 (0)