exo-addons / skype

Make Skype calls directly from eXo Platform.
GNU Lesser General Public License v3.0
1 stars 0 forks source link

Call Button doesn't appear on Chat page load #1

Closed pnedonosko closed 6 years ago

pnedonosko commented 7 years ago

When open Chat page a Call Button may not appear. Discovering the problem found, that the button doesn't appear when Chat app requests to WhoIsOnline service take time above 500ms (it may be 700ms as well). Internally, in Call Button provider script, we cannot tie to the Chat process (there is no promise/callback on ready state), and we need wait in timeout function. But it's dependent on a network latency and server speed. Initially, it was used a timeout 300ms for Chat's buttons, but on eXo Tribe requests run longer and chat app not yet initialized when the timeout function starts to work on the whole page reload. As result the call provider code assumes there is no chat room open and doesn't add a Call Button to the Chat page. This doesn't happen when switch to a chat room in left side bar.

Need find a way how to properly listen to the Chat app object to start init a Call Button when the app is fully initialized. This should take in account when Chat app actually doesn't have a chat room loaded (user opens the chat first time, e.g. after a login in portal).

Technically, we need know when chatApplication.targetUser and related properties will be initialized or they will not at all.

pnedonosko commented 6 years ago

Resolved in 1.0.0