Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch SfB meetings by clicking on a link #205

Open
wants to merge 5 commits into
base: launchpad-next
Choose a base branch
from

Conversation

xhaakon
Copy link
Contributor

@xhaakon xhaakon commented Oct 22, 2019

No description provided.

Copy link
Contributor Author

@xhaakon xhaakon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@risbeove I integrated your files into SIPE source code and made some minor changes (see the individual commits). It seems to work fine when I click a link in a SfB e-mail invitation in Thunderbird.

I have reservation about the part of your script I marked and commented on directly in the code. I'm willing to accept it as-is into the custom package build in sipe-collab PPA, but I'd like to push this feature into upstream SIPE without the code in question.

Please check my modifications, I'll try to update the PPA soon.

Comment on lines +48 to +92
# Close SfB tab in browser
if hash xdotool 2>/dev/null; then
WID=$(xdotool search --name "Skype for Business Web App" | head -1)
if [ -n "$WID" ]; then
xdotool windowactivate --sync $WID
xdotool key --clearmodifiers ctrl+w
fi
fi

# Make Pidgin chat window active (Skip "Buddy List")
if hash xdotool 2>/dev/null; then
for PIDGIN_PID in $(pgrep pidgin); do
for WID in $(xdotool search --onlyvisible --pid $PIDGIN_PID); do
if [ "$(xdotool getwindowname $WID)" != "Buddy List" ]; then
xdotool windowactivate --sync $WID
fi
done
done
fi

# Auto join meeting
if hash xdotool 2>/dev/null; then
SECONDS=0
while [ $SECONDS -lt 120 ]; do
WID=$(xdotool search --name "Office Communicator" | head -1)
if [ -n "$WID" ]; then
xdotool windowactivate --sync $WID
xdotool key --clearmodifiers Return
break
fi
done
fi

# Auto join shared screen
if hash xdotool 2>/dev/null; then
SECONDS=0
while [ $SECONDS -lt 30 ]; do
WID=$(xdotool search --name "Office Communicator" | head -1)
if [ -n "$WID" ]; then
xdotool windowactivate --sync $WID
xdotool key --clearmodifiers Return
break
fi
done
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this fiddling with with windows. I guess it will work in your specific use case, however, I feel in its present shape it isn't fit for upstream:

  • The solution is X11-specific, doesn't work with Wayland and never will since these features like sending fake keyboard input to random windows were explicitly removed from Wayland specification for security reasons.
  • It is quite fragile since it relies on things like text in window headers, which is prone to get changed without notice, or getting PID of the pidgin process with pgrep (there may be several instances running at the same time if this is a multi user machine).

IMO anyone willing to implement this properly should focus on these areas:

  • Service im.pidgin.purple.PurpleService that Pidgin exposes on session DBus should be made activatable, so that we don't have to check if Pidgin is running and possibly launch it manually (line 24) - whenever the service is accessed, DBus should launch Pidgin automatically.

  • SipeJoinConferenceWithUri method should have a boolean parameter (e.g. join_call) that when True, makes Sipe connect to the conference call and screencast automatically, skipping any popup dialogs user would have to confirm.

  • Optionally, Pidgin could expose PurpleConversationSetFocus method on DBus that would bring the chat window with the given conversation to front, replacing xdotool windowactivate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant