galaxy_blizzard_plugin icon indicating copy to clipboard operation
galaxy_blizzard_plugin copied to clipboard

Chat with Friends/Guild is missing & User presence with statuses

Open yoshimo opened this issue 4 years ago • 6 comments

Describe the bug We can't talk to people from our battle net friendlist and not with our guilds although the smartphone app and desktop app support it

Expected behavior See other peoples online status, what they are playing, chars they might use and get into the wow guild chat.

The question is, can we do that ? Since there is no official api, one would have to unpin the application traffic and check their protocol and re-implement it.

Looking at the Mobile App, this seems to be an implementation of XMPP as there is a xmpp library inside.

yoshimo avatar Jun 13 '20 11:06 yoshimo

Hi, yes. There was some work on XMPP with previous authors of the plugin. There are even some proto files inside this repo. Currenlty I have no time to dig into this unfortunately, but feel free to try:)

The only feature that uses XMPP was friends list, see this: https://github.com/FriendsOfGalaxy/galaxy-integration-battlenet/issues/32 there is the code on that repo - maybe it works again?

Second feature would be online presence - Galaxy API has methods for this.

No Galaxy chat support yet.

bartok765 avatar Jun 15 '20 09:06 bartok765

@bartok765 I started digging into the old implementation of friends list and worked on it a couple of weeks (months?) ago, but did not have the time to continue lately. I started researching some more yesterday and will work on it again in the next couple of days.

I pushed my WIP at https://github.com/elkangaroo/galaxy_blizzard_plugin/tree/feature/friends_presence

Status Quo in my branch is:

  • fetching friends list works, but need to refactor to get the battletag there
  • fetching friends presence "works" in the way that I can distinguesh friends that are offline from friends that are "online" (cannot distinguish online, afk, dnd yet)
  • results are only shown in log files yet, they do not show in the Galaxy friends sidebar yet, I believe this needs to be "turned on" for battlenet from GOG first (similar to this: https://github.com/gogcom/galaxy-integrations-python-api/issues/89)

elkangaroo avatar Jun 17 '20 08:06 elkangaroo

@elkangaroo may i ask you how you did it? The official apps do not like being spied upon and would need extra convincing to spill the tls keys.

yoshimo avatar Jun 17 '20 09:06 yoshimo

@yoshimo Thankfully, the reverse engineering of the protocol has been done by other folks. I think a alot has been done over at HearthSim, that is also where the protobuf files originate (hsproto). I also found this battlenet plugin for libpurple which provides useful information.

For authentication it uses the (cached) cookie jar from the Galaxy login and pretends to be the battlenet mobile app I think.

I just pushed another update to my branch, current state:

  • friends presence now also shows "away" state
  • friends presence now shows currently played game (😄)
    • only tested with Overwatch so far
    • does not yet reliably work when friend is logged in multiple times (devices?) (checks only the first one)

elkangaroo avatar Jun 18 '20 19:06 elkangaroo

@elkangaroo can you create PR for this? User presence is really step forward for this plugin but I have no time for testing it by my own, but I'm pinning this issue to be more visible by community

bartok765 avatar Jul 03 '20 16:07 bartok765

@bartok765 I will create a PR now after I pushed my last WIP changes. I will add what's working and what's not and what needs to be fixed / worked on before this can be merged.

elkangaroo avatar Jul 11 '20 19:07 elkangaroo