xiehuc / pidgin-lwqq

a pidgin plugin based on lwqq, a excellent safe useful library for webqq protocol
GNU General Public License v3.0
660 stars 185 forks source link

群消息不显示名片名称 #50

Closed maplebeats closed 12 years ago

maplebeats commented 12 years ago

请求群member信息的返回的json数据里有个cards,内容是{'muin':xxxxxxxx,'card':'XXXXX'}。用card来换掉群里的nick 群里没人设置card,返回的数据里就会没有cards这个字典。

我用py写的建立{uin:nick}的字典像这样子的 [code] self._user_info.update(dict([(x['uin'],x['nick']) for x in data['result']['minfo']])) try: self._user_info.update(dict([(x['muin'],x['card']) for x in data['result']['cards']])) except KeyError: logger.warn("the <%s> have no cards" % i['name']) [/code]

我只能尽可能的提供信息了

xiehuc commented 12 years ago

这个cards是设置的群名片备注吗?你吧返回的json结果贴一下 看下什么样子的好改

在 2012-8-24,下午11:24,"≡(▔﹏▔)≡" notifications@github.com 写道:

请求群member信息的返回的json数据里有个cards,内容是{'muin':xxxxxxxx,'card':'XXXXX'}。用card来换掉群里的nick 群里没人设置card,返回的数据里就会没有cards这个字典。

我用py写的建立{uin:nick}的字典像这样子的 [code] self._user_info.update(dict([(x['uin'],x['nick']) for x in data['result']['minfo']])) try: self._user_info.update(dict([(x['muin'],x['card']) for x in data['result']['cards']])) except KeyError: logger.warn("the <%s> have no cards" % i['name']) [/code]

我只能尽可能的提供信息了

— Reply to this email directly or view it on GitHubhttps://github.com/xiehuc/pidgin-lwqq/issues/50.

maplebeats commented 12 years ago

{"retcode":0,"result":{"stats":[{"client_type":1,"uin":2586760763,"stat":10},{"client_type":41,"uin":2247188221,"stat":10},{"client_type":41,"uin":506024007,"stat":10}],"minfo":[{"nick":"アニメ社長","province":"","gender":"unknown","uin":2586760763,"country":"","city":""},{"nick":"maplebeats","province":"重庆","gender":"male","uin":2247188221,"country":"中国","city":"南岸"},{"nick":"~","province":"重庆","gender":"female","uin":506024007,"country":"中国","city":""}],"ginfo":{"face":0,"memo":"","class":10021,"fingermemo":"","code":2813455210,"createtime":1345442642,"flag":16777217,"level":0,"name":"webqq test","gid":572469944,"owner":2247188221,

“cards":{"muin":xxxxxx,"card":xxxxxxx}, ---就是这个,当群里没有人设置名片的时候,没有这个数据

"members":[{"muin":2586760763,"mflag":132},{"muin":2247188221,"mflag":4},{"muin":506024007,"mflag":4}],"option":2},"vipinfo":[{"vip_level":0,"u":2586760763,"is_vip":0},{"vip_level":0,"u":2247188221,"is_vip":0},{"vip_level":0,"u":506024007,"is_vip":0}]}}

xiehuc commented 12 years ago

是这样的.如果你加了某个人为好友.那么显示的是这个好友的名称而不是群名片. 这个是没有办法更改的. 如果你没有加这个人.那么可以提交一个patch显示群名片

xiehuc commented 12 years ago

我提交了一个补丁在dev你看看吧.

maplebeats commented 12 years ago

已经成功显示了。thanks