agent: Move UPnP handling to each stream
Also rewrite the logic a little, and try to make the code a little clearer.
Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
Also rewrite the logic a little, and try to make the code a little clearer.