tomer8007 / kik-bot-api-unofficial

Python API for writing unoffical Kik bots that act like humans
MIT License
128 stars 77 forks source link

don't ignore status and sysmsg in group msg handler #156

Closed 3dik closed 4 years ago

3dik commented 4 years ago

When I receive "status" or "sysmsg" messages, they are not forwarded to the callback object because each message of type "groupchat" is processed by GroupXMPPMessageHandler if its node contains an "xmlns" attribute. Compare the method _handle_kik_event. At least on my setup, many, if not all, received messages do contain that "xmlns" attribute. For example:

I did not really understand the iPad-specific edge case. Is this outdated by 9ea8795063a353a212b? That commit removed the namespace check for "kik:groups".

Anyway, GroupXMPPMessageHandler and XMPPMessageHandler already have redundant code for IncomingGroupChatMessage and IncomingGroupIsTyping. So I thought that just copying the other two if branches might be fine in the context of this PR.

I don't know if there are more, equivalent bugs.

tomer8007 commented 4 years ago

Yes, the ideal is to get rid of the xmlns-based dispatching and dispatch by type instead. Then we can merge the generic XMPPMessageHandler with _handle_kik_event.

Thanks for pointing it out, anyway. I always wanted to delete the xmlns condition.