Fix #2323 (implement XEP-0012 last activity)

TODO: check if this method of setting activity isn’t a bit heavy.