core (plugins): added missing contants + use of new constants in PLUGIN_INFO
This commit is contained in:
parent
97337202cb
commit
ac7d587c49
72 changed files with 586 additions and 560 deletions
|
|
@ -19,20 +19,21 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sat.core.i18n import _, D_
|
||||
from sat.core.constants import Const as C
|
||||
from sat.core.log import getLogger
|
||||
log = getLogger(__name__)
|
||||
|
||||
|
||||
PLUGIN_INFO = {
|
||||
"name": "Directory subscription plugin",
|
||||
"import_name": "DIRECTORY-SUBSCRIPTION",
|
||||
"type": "TMP",
|
||||
"protocols": [],
|
||||
"dependencies": ["XEP-0050", "XEP-0055"],
|
||||
"recommendations": [],
|
||||
"main": "DirectorySubscription",
|
||||
"handler": "no",
|
||||
"description": _("""Implementation of directory subscription""")
|
||||
C.PI_NAME: "Directory subscription plugin",
|
||||
C.PI_IMPORT_NAME: "DIRECTORY-SUBSCRIPTION",
|
||||
C.PI_TYPE: "TMP",
|
||||
C.PI_PROTOCOLS: [],
|
||||
C.PI_DEPENDENCIES: ["XEP-0050", "XEP-0055"],
|
||||
C.PI_RECOMMENDATIONS: [],
|
||||
C.PI_MAIN: "DirectorySubscription",
|
||||
C.PI_HANDLER: "no",
|
||||
C.PI_DESCRIPTION: _("""Implementation of directory subscription""")
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -55,7 +56,7 @@ class DirectorySubscription(object):
|
|||
@return: a deferred dict{unicode: unicode}
|
||||
"""
|
||||
d = self.host.plugins["XEP-0055"]._getHostServices(profile)
|
||||
|
||||
|
||||
def got_services(services):
|
||||
service_jid = services[0]
|
||||
session_id, session_data = self.host.plugins["XEP-0050"].requesting.newSession(profile=profile)
|
||||
|
|
@ -63,5 +64,5 @@ class DirectorySubscription(object):
|
|||
session_data["node"] = CMD_UPDATE_SUBSCRIBTION
|
||||
data = {"session_id": session_id}
|
||||
return self.host.plugins["XEP-0050"]._requestingEntity(data, profile)
|
||||
|
||||
|
||||
return d.addCallback(got_services)
|
||||
|
|
|
|||
Loading…
Reference in a new issue