Welcome to mirror list, hosted at ThFree Co, Russian Federation.

status-from-vk.py « extensions - github.com/mrDoctorWho/vk4xmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6ad2f0f9b5640ded513795ced8d403849a67debc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# coding: utf-8
# This file is a part of VK4XMPP transport
# © simpleApps, 2014.

"""
This plugin allows user to see his friends status messages
"""

GLOBAL_USER_SETTINGS["status_from_vk"] = {"label": "Show my friends status messages", "value": 0}


def statusfromvk_evt07(user):
	if user and user.settings.status_from_vk:
		user.vk.friends_fields.add("status")


def statusfromvk_prs02(prs, destination, source):
	if source != TransportID and destination in Users:
		user = Users[destination]
		if user.settings.status_from_vk and not prs.getType():
			id = vk2xmpp(source)
			if id in user.friends and user.friends[id].get("status"):
				prs.setStatus(user.friends[id]["status"])


registerHandler("evt07", statusfromvk_evt07)
registerHandler("prs02", statusfromvk_prs02)