Giter Site home page Giter Site logo

Comments (8)

littlecodersh avatar littlecodersh commented on May 20, 2024

@brothertian
我个人认为过滤掉@信息没有必要。

  1. 放进模块并非实现需求的唯一方法,这一操作在模块外处理也极为简单
  2. 造成部分信息的缺失,如第一部分的参与者:@111,第二部分的参与者:@222,第三部分的参与者@333”,过滤掉后信息会严重缺失
  3. 过滤也是一定的处理开销,特别是在群聊消息本身就较多的情况下
    所以,我并不建议过滤掉@信息
    另,Content键中的值是原始信息,Text键中的值是去除群聊都有的头部分的消息,并不重复

@联系人的信息存储这个需求过于小众,考虑相关处理开销,不会放进模块
如果有相关需求,可以自行修改

手动输入@联系人名的话,在我测试过的各客户端微信中本就不会被识别成@消息,建议充分测试后再提交相关bug

from itchat.

brothertian avatar brothertian commented on May 20, 2024

@littlecodersh 感谢答复,@联系人名的问题,检测下来是这样的,某些版本微信在某些时候(不是每次,没找到规律)发送的@联系人,分隔符不是\u2005,而是空格,因此将client.py的__produce_group_chat函数msg['isAt'] = u'@%s\u2005'改为(u'@%s\u2005'或者 u'@%s ')就可以识别啦,不知道有没有什么副作用。

from itchat.

littlecodersh avatar littlecodersh commented on May 20, 2024

@brothertian 可以提供空格的微信版本吗?
这样修改会导致大量的误识别,如果能确定空格的微信版本,我们可以讨论一下这里怎么修改。

from itchat.

brothertian avatar brothertian commented on May 20, 2024

@littlecodersh 之前有问题的微信版本为6.3.16,安卓系统,未找到规律,有时候发出的正常,有时候发出的为空格,而且有问题的信息复制后粘贴也同样有问题。

from itchat.

littlecodersh avatar littlecodersh commented on May 20, 2024

@brothertian 未能复现问题,读取为空格的消息在别的机器上是否能显示系统的@提示?

from itchat.

brothertian avatar brothertian commented on May 20, 2024

@littlecodersh 其它机器未显示有人@我的提示.

from itchat.

littlecodersh avatar littlecodersh commented on May 20, 2024

@brothertian 所以我认为itchat这里也不应当显示为有人@我,你觉得呢?

from itchat.

brothertian avatar brothertian commented on May 20, 2024

@littlecodersh 对,我也这么认为,只是不清楚是否微信的bug还是什么其它原因,毕竟从使用者角度来看,他发出的@信息未得到相应的反馈,会产生疑惑。
看来这个问题也需要在模块外做二次检测比较合适。

from itchat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.