Update all plugins for renamed settings functions

This commit is contained in:
James Booth
2016-08-07 00:17:42 +01:00
parent afc2a585a3
commit 72542b75dc
4 changed files with 39 additions and 39 deletions

View File

@@ -6,16 +6,16 @@ def _show_settings():
prof.cons_show("")
prof.cons_show("Presence notify plugin settings:")
mode = prof.settings_get_string("presence_notify", "mode", "all")
mode = prof.settings_string_get("presence_notify", "mode", "all")
prof.cons_show("Mode: {mode}".format(mode=mode))
resource = prof.settings_get_boolean("presence_notify", "resource", False)
resource = prof.settings_boolean_get("presence_notify", "resource", False)
if resource:
prof.cons_show("Resource: ON")
else:
prof.cons_show("Resource: OFF")
ignored_list = prof.settings_get_string_list("presence_notify", "ignored")
ignored_list = prof.settings_string_list_get("presence_notify", "ignored")
if ignored_list and len(ignored_list) > 0:
prof.cons_show("Ignored:")
for contact in ignored_list:
@@ -24,23 +24,23 @@ def _show_settings():
def _cmd_presence_notify(arg1=None, arg2=None, arg3=None):
if arg1 == "all":
prof.settings_set_string("presence_notify", "mode", "all")
prof.settings_string_set("presence_notify", "mode", "all")
prof.cons_show("Notifying on all presence changes")
return
if arg1 == "online":
prof.settings_set_string("presence_notify", "mode", "online")
prof.settings_string_set("presence_notify", "mode", "online")
prof.cons_show("Notifying on online/offline presence changes only")
return
if arg1 == "off":
prof.settings_set_string("presence_notify", "mode", "off")
prof.settings_string_set("presence_notify", "mode", "off")
prof.cons_show("Presence notifications disabled")
return
if arg1 == "ignored":
if arg2 == "clear":
prof.settings_string_list_remove_all("presence_notify", "ignored")
prof.settings_string_list_clear("presence_notify", "ignored")
prof.cons_show("Removed all ignored contacts for presence notifications")
return
@@ -68,11 +68,11 @@ def _cmd_presence_notify(arg1=None, arg2=None, arg3=None):
if arg1 == "resource":
if arg2 == "on":
prof.settings_set_boolean("presence_notify", "resource", True)
prof.settings_boolean_set("presence_notify", "resource", True)
prof.cons_show("Showing resource in presence notifications")
return;
if arg2 == "off":
prof.settings_set_boolean("presence_notify", "resource", False)
prof.settings_boolean_set("presence_notify", "resource", False)
prof.cons_show("Hiding resource in presence notifications")
return;
@@ -116,11 +116,11 @@ def prof_init(version, status, account_name, fulljid):
def _do_notify(barejid, presence):
ignored = prof.settings_get_string_list("presence_notify", "ignored")
ignored = prof.settings_string_list_get("presence_notify", "ignored")
if ignored and barejid in ignored:
return False
mode = prof.settings_get_string("presence_notify", "mode", "all")
mode = prof.settings_string_get("presence_notify", "mode", "all")
if mode == "all":
return True
elif mode == "online":
@@ -143,7 +143,7 @@ def _do_notify(barejid, presence):
def prof_on_contact_presence(barejid, resource, presence, status, priority):
if _do_notify(barejid, presence):
jid = barejid
if prof.settings_get_boolean("presence_notify", "resource", False):
if prof.settings_boolean_get("presence_notify", "resource", False):
jid = jid + "/" + resource
message = "{jid} is {presence}".format(jid=jid, presence=presence)
if status:
@@ -155,7 +155,7 @@ def prof_on_contact_presence(barejid, resource, presence, status, priority):
def prof_on_contact_offline(barejid, resource, status):
if _do_notify(barejid, "offline"):
jid = barejid
if prof.settings_get_boolean("presence_notify", "resource", False):
if prof.settings_boolean_get("presence_notify", "resource", False):
jid = jid + "/" + resource
message = "{jid} is offline".format(jid=jid)
if status: