Skip to content

Commit ce16f1c

Browse files
committed
UPDATE: Minor tweaks.
1 parent 646b8bc commit ce16f1c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/main/java/com/oasisfeng/nevo/decorators/wechat/MessagingBuilder.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class MessagingBuilder {
6464
private static final int MAX_NUM_HISTORICAL_LINES = 10;
6565

6666
private static final String ACTION_REPLY = "REPLY";
67-
private static final String ACTION_MENTION = "MENTION";
6867
private static final String SCHEME_KEY = "key";
6968
private static final String EXTRA_REPLY_ACTION = "pending_intent";
7069
private static final String EXTRA_RESULT_KEY = "result_key";
@@ -129,6 +128,8 @@ class MessagingBuilder {
129128
final Pair<CharSequence/* Text */, CharSequence/* Ticker */> line = lines.valueAt(i);
130129
messaging.addMessage(buildMessage(conversation, lines.keyAt(i), line.second, line.first, sender_inline ? null : title.toString()));
131130
}
131+
132+
Log.i(TAG, "Built from archive.");
132133
return messaging;
133134
}
134135

@@ -352,7 +353,7 @@ interface Controller {
352353
mController = controller;
353354
mUserSelf = buildPersonFromProfile(context);
354355

355-
final IntentFilter filter = new IntentFilter(ACTION_REPLY); filter.addAction(ACTION_MENTION); filter.addDataScheme(SCHEME_KEY);
356+
final IntentFilter filter = new IntentFilter(ACTION_REPLY); filter.addDataScheme(SCHEME_KEY);
356357
context.registerReceiver(mReplyReceiver, filter);
357358
}
358359

src/main/java/com/oasisfeng/nevo/decorators/wechat/WeChatDecorator.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ public class WeChatDecorator extends NevoDecoratorService {
180180
conversation.timestamp = n.when;
181181
conversation.ext = IGNORE_CAR_EXTENDER ? null : new Notification.CarExtender(n).getUnreadConversation();
182182

183-
if (conversation.isTypeUnknown())
184-
conversation.setType(WeChatMessage.guessConversationType(conversation)); // mMessagingBuilder replies on the type
185-
186183
final String original_key = evolving.getOriginalKey();
187184
MessagingStyle messaging = mMessagingBuilder.buildFromConversation(conversation, evolving);
188185
if (messaging == null) // EXTRA_TEXT will be written in buildFromArchive()
@@ -212,7 +209,8 @@ public class WeChatDecorator extends NevoDecoratorService {
212209
: key.startsWith("gh_") || key.equals(KEY_SERVICE_MESSAGE) ? TYPE_BOT_MESSAGE
213210
: key.endsWith("@openim") ? TYPE_DIRECT_MESSAGE : TYPE_UNKNOWN;
214211
conversation.setType(type);
215-
}
212+
} else if (conversation.isTypeUnknown())
213+
conversation.setType(WeChatMessage.guessConversationType(conversation));
216214

217215
if (SDK_INT >= Build.VERSION_CODES.R && input_history != null) { // EXTRA_REMOTE_INPUT_HISTORY is not longer supported on Android R.
218216
for (int i = input_history.length - 1; i >= 0; i--) // Append them to messages in MessagingStyle.

src/main/res/values/strings.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<string name="decorator_wechat_description">符合当代 Android 的最佳通知体验:会话样式、直接回复、划除即已读等高级特性。</string>
2222
<string name="self_display_name">你</string>
2323
<string name="action_reply">回复</string>
24-
<string name="action_preview_image">预览图片</string>
2524
<string name="header_group_chat">群聊</string>
2625
<string name="header_bot_message">微信号</string>
2726
<string name="header_service_message">服务消息</string>
@@ -47,12 +46,12 @@
4746
<string name="pref_compat_mode_title">兼容模式 (试验性)</string>
4847
<string name="pref_compat_mode_summary">强制设备全局进入兼容模式,其影响与具体设备有关。(例如 “息屏显示” 或 “双击唤醒” 无法工作)\n最新版本微信需要这个模式才能启用特性扩展包。</string>
4948
<string name="pref_agent_title">体验增强包</string>
50-
<string name="pref_agent_summary">通过安装一个微信的替身,可消除女娲石在外源模式下的微信通知前缀,支持通知圆点(需启动器支持),并提供“扫码”的快捷方式。</string>
49+
<string name="pref_agent_summary">通过安装一个微信的替身,支持快捷方式(“扫码”及最近的会话)、通知圆点(需启动器支持)、聊天气泡(Android 11+)等特性,还可消除女娲石工作在外源模式时微信通知前缀。</string>
5150
<string name="pref_agent_summary_prefix_enabled">已启用</string>
5251
<string name="pref_agent_summary_prefix_disabled">已禁用</string>
5352
<string name="pref_agent_summary_installed">启用此功能后,启动器中会多出一个与微信相同图标的启动入口,它是一个微信启动图标的“替身”,通知圆点(需启动器支持)和“扫码”快捷方式(Android 7.1+)将显示在其上。\n点击可切换此替身的显示名或禁用。</string>
5453
<string name="pref_agent_summary_update">有更新版本,请点击这里开始升级。🆕</string>
55-
<string name="action_disable_agent_launcher_entrance">隐藏替身的启动入口</string>
54+
<string name="action_disable_agent_launcher_entrance">隐藏替身的启动入口\n(将失去“快捷方式”和“消息气泡”)</string>
5655
<string name="pref_alert_dedup_title">解决双重提示问题</string>
5756
<string name="pref_alert_dedup_summary">消除双重提示音、震动及横幅快速闪替。</string>
5857
<string name="pref_alert_dedup_guide">如果遇到通知横幅的闪替问题,请关闭微信本身通知设置中“新消息通知”的横幅选项(或调降重要性)。\n\n如果遇到双重提示音或震动,请关闭微信本身通知设置中“新消息通知”的提示音或震动。\n\n请避免修改除“新消息通知”之外的其它通知类别。</string>

0 commit comments

Comments
 (0)