Skip to content
This repository has been archived by the owner on Nov 12, 2018. It is now read-only.

新表情方案: 收到消息时修改其内容 #13

Merged
merged 7 commits into from
Feb 26, 2016

Conversation

arrowrowe
Copy link
Contributor

  • 新功能
    • 阻止撤回.
    • 在控制台显示微信原有的调试信息.
  • 重写的功能
    • 重写表情方案, 改为锁定表情消息为图片消息.
  • 需要测试
    • 接收表情.
    • 阻止撤回 (包括自己和别人).
  • 实现说明
    • angular.bootstrap 之前插入 angular.module(...).config 以修改 $httpProvider.defaults.transformResponse, 从而在收到消息时处理它. 以此实现了新表情方案和阻止撤回.
    • 锁定 window.console.
    • 以上两者的锁定都用 Object.defineProperty 实现.

- Hack `angular.bootstrap` to configure `$httpProvider.defaults.transformResponse`.
- Lock emoji messages as image messages.
Change recalling command to a system message.

Todo: mark the should-be-recalled message, maybe with `<del>`?
Conflicts:
- .gitignore
  - Both added `node_modules`.
geeeeeeeeek pushed a commit that referenced this pull request Feb 26, 2016
新表情方案: 收到消息时修改其内容
@geeeeeeeeek geeeeeeeeek merged commit 27ecf7c into geeeeeeeeek:master Feb 26, 2016
@geeeeeeeeek
Copy link
Owner

@arrowrowe 你的思路很有启发!不过替换成MSGTYPE_IMAGE可能不是最好的选择,因为贴纸还是显示在消息气泡中,且大小不受控制。

我看了一下发现,用户自定义贴纸和表情商店中贴纸消息的差异只在于MMActualContent是否注入,因此只需要这样修改即可。

let actualContent = msg.Content;
lock(msg, 'MMActualContent', actualContent);
lock(msg, 'MMDigest', '[Emoticon resolved by Electronic WeChat]');
lock(msg, 'MsgType', constants.MSGTYPE_EMOTICON);

现在效果是这样的,可以看我的后续提交:
image

@arrowrowe
Copy link
Contributor Author

re @geeeeeeeeek: 0.0 这样更好! 原本觉得作为图片就可以了 (还能点击放大 = =), 现在觉得这样作为真・表情实现更自然了.

@admk
Copy link

admk commented May 5, 2016

敝人有一拙见,能否将接受过的表情or贴纸都存本地,这样可以从ui中选择发送已接受过的表情?还请指正

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

Successfully merging this pull request may close these issues.

4 participants