Bug 1068618 - [Loop] The shared link sms message is wrong. r=julien

This whole function is not very readable for one reason: if there is a threadId, we don't use any of other values. Maybe it's possible to do it better by splitting it in half: one part does the visibilitychange stuff and returns a promise, the other part does the action (and then maybe the caller can chose the action, instead of having spaghetti code here).

I'm totally fine with doing all of this in a separate bug.