addressbook.py 1.01 KB
Newer Older
1 2 3 4 5

"""Blink addressbook settings extensions."""

__all__ = ['ContactExtension', 'GroupExtension']

6 7
from sipsimple.addressbook import ContactExtension, GroupExtension, PresenceSettings, SharedSetting
from sipsimple.configuration import Setting, RuntimeSetting
8 9 10 11 12 13 14

from blink.configuration.datatypes import IconDescriptor


SharedSetting.set_namespace('ag-projects:blink')


15
class PresenceSettingsExtension(PresenceSettings):
Adrian Georgescu's avatar
Adrian Georgescu committed
16 17
    state = RuntimeSetting(type=str, nillable=True, default=None)
    note = RuntimeSetting(type=str, nillable=True, default=None)
18 19


20
class ContactExtension(ContactExtension):
21
    presence = PresenceSettingsExtension
22
    icon = Setting(type=IconDescriptor, nillable=True, default=None)
23 24
    alternate_icon = Setting(type=IconDescriptor, nillable=True, default=None)
    preferred_media = SharedSetting(type=str, default='audio')
25
    auto_answer = Setting(type=bool, default=False)
26 27 28 29 30 31 32


class GroupExtension(GroupExtension):
    position = Setting(type=int, nillable=True)
    collapsed = Setting(type=bool, default=False)