annotate libervia/backend/plugins/plugin_xep_0092.py @ 4202:b26339343076

core: use a user specific directory for PID file: default location of pid file is now specific to logged user, this allow to run several instances of Libervia by different users on the same machine without PID conflicts.
author Goffi <goffi@goffi.org>
date Sun, 14 Jan 2024 17:48:02 +0100
parents 4b842c1fb686
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
1 #!/usr/bin/env python3
3137
559a625a236b fixed shebangs
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
2
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
3
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # SàT plugin for Software Version (XEP-0092)
3479
be6d91572633 date update
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
5 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org)
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
6
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # This program is free software: you can redistribute it and/or modify
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # (at your option) any later version.
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
11
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # GNU Affero General Public License for more details.
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
16
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
19
4066
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
20 from typing import Tuple
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
21
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
22 from twisted.internet import defer, reactor
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 952
diff changeset
23 from twisted.words.protocols.jabber import jid
945
899dc9cd0f35 plugin XEP-0092: feature check before requesting version
Goffi <goffi@goffi.org>
parents: 941
diff changeset
24 from wokkel import compat
4066
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
25
4071
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4066
diff changeset
26 from libervia.backend.core import exceptions
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4066
diff changeset
27 from libervia.backend.core.constants import Const as C
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4066
diff changeset
28 from libervia.backend.core.core_types import SatXMPPEntity
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4066
diff changeset
29 from libervia.backend.core.i18n import _
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4066
diff changeset
30 from libervia.backend.core.log import getLogger
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
31
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 971
diff changeset
32 log = getLogger(__name__)
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
33
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
34 NS_VERSION = "jabber:iq:version"
952
91836a647515 plugin XEP-0092: use of checkFeature instead of hasFeature + timeout + message adapted to failure if software version is not available
Goffi <goffi@goffi.org>
parents: 945
diff changeset
35 TIMEOUT = 10
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
36
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
37 PLUGIN_INFO = {
2145
33c8c4973743 core (plugins): added missing contants + use of new constants in PLUGIN_INFO
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
38 C.PI_NAME: "Software Version Plugin",
33c8c4973743 core (plugins): added missing contants + use of new constants in PLUGIN_INFO
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
39 C.PI_IMPORT_NAME: "XEP-0092",
33c8c4973743 core (plugins): added missing contants + use of new constants in PLUGIN_INFO
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
40 C.PI_TYPE: "XEP",
33c8c4973743 core (plugins): added missing contants + use of new constants in PLUGIN_INFO
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
41 C.PI_PROTOCOLS: ["XEP-0092"],
33c8c4973743 core (plugins): added missing contants + use of new constants in PLUGIN_INFO
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
42 C.PI_DEPENDENCIES: [],
33c8c4973743 core (plugins): added missing contants + use of new constants in PLUGIN_INFO
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
43 C.PI_RECOMMENDATIONS: [C.TEXT_CMDS],
33c8c4973743 core (plugins): added missing contants + use of new constants in PLUGIN_INFO
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
44 C.PI_MAIN: "XEP_0092",
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
45 C.PI_HANDLER: "no", # version is already handler in core.xmpp module
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
46 C.PI_DESCRIPTION: _("""Implementation of Software Version"""),
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
47 }
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
48
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
49
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
50 class XEP_0092(object):
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
51 def __init__(self, host):
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 971
diff changeset
52 log.info(_("Plugin XEP_0092 initialization"))
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
53 self.host = host
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
54 host.bridge.add_method(
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
55 "software_version_get",
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
56 ".plugin",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
57 in_sign="ss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
58 out_sign="(sss)",
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
59 method=self._get_version,
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
60 async_=True,
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
61 )
926
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
62 try:
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
63 self.host.plugins[C.TEXT_CMDS].add_who_is_cb(self._whois, 50)
926
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
64 except KeyError:
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 971
diff changeset
65 log.info(_("Text commands not available"))
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
66
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
67 def _get_version(self, entity_jid_s, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
68 def prepare_for_bridge(data):
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 952
diff changeset
69 name, version, os = data
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
70 return (name or "", version or "", os or "")
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
71
4066
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
72 client = self.host.get_client(profile_key)
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
73 d = self.version_get(client, jid.JID(entity_jid_s))
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
74 d.addCallback(prepare_for_bridge)
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 952
diff changeset
75 return d
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 952
diff changeset
76
4066
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
77 def version_get(
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
78 self,
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
79 client: SatXMPPEntity,
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
80 jid_: jid.JID,
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
81 ) -> Tuple[str, str, str]:
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
82 """Ask version of the client that jid_ is running
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
83
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
84 @param jid_: jid from who we want to know client's version
4066
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
85 @return: a defered which fire a tuple with the following data (None if not available):
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
86 - name: Natural language name of the software
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
87 - version: specific version of the software
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
88 - os: operating system of the queried entity
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
89 """
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
90
4066
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
91 def do_version_get(__):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
92 iq_elt = compat.IQ(client.xmlstream, "get")
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
93 iq_elt["to"] = jid_.full()
945
899dc9cd0f35 plugin XEP-0092: feature check before requesting version
Goffi <goffi@goffi.org>
parents: 941
diff changeset
94 iq_elt.addElement("query", NS_VERSION)
899dc9cd0f35 plugin XEP-0092: feature check before requesting version
Goffi <goffi@goffi.org>
parents: 941
diff changeset
95 d = iq_elt.send()
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
96 d.addCallback(self._got_version)
945
899dc9cd0f35 plugin XEP-0092: feature check before requesting version
Goffi <goffi@goffi.org>
parents: 941
diff changeset
97 return d
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
98
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
99 d = self.host.check_feature(client, NS_VERSION, jid_)
4066
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
100 d.addCallback(do_version_get)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
101 reactor.callLater(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
102 TIMEOUT, d.cancel
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
103 ) # XXX: timeout needed because some clients don't answer the IQ
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
104 return d
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
105
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
106 def _got_version(self, iq_elt):
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
107 try:
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
108 query_elt = next(iq_elt.elements(NS_VERSION, "query"))
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
109 except StopIteration:
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
110 raise exceptions.DataError
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
111 ret = []
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
112 for name in ("name", "version", "os"):
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
113 try:
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
114 data_elt = next(query_elt.elements(NS_VERSION, name))
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
115 ret.append(str(data_elt))
920
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
116 except StopIteration:
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
117 ret.append(None)
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
118
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
119 return tuple(ret)
45dffd67a18a plugin XEP-0092: new plugin (software version)
Goffi <goffi@goffi.org>
parents:
diff changeset
120
1963
a2bc5089c2eb backend, frontends: message refactoring (huge commit):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
121 def _whois(self, client, whois_msg, mess_data, target_jid):
4066
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
122 """Add software/OS information to whois"""
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
123
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
124 def version_cb(version_data):
926
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
125 name, version, os = version_data
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
126 if name:
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
127 whois_msg.append(_("Client name: %s") % name)
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
128 if version:
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
129 whois_msg.append(_("Client version: %s") % version)
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
130 if os:
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
131 whois_msg.append(_("Operating system: %s") % os)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
132
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
133 def version_eb(failure):
952
91836a647515 plugin XEP-0092: use of checkFeature instead of hasFeature + timeout + message adapted to failure if software version is not available
Goffi <goffi@goffi.org>
parents: 945
diff changeset
134 failure.trap(exceptions.FeatureNotFound, defer.CancelledError)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
135 if failure.check(failure, exceptions.FeatureNotFound):
952
91836a647515 plugin XEP-0092: use of checkFeature instead of hasFeature + timeout + message adapted to failure if software version is not available
Goffi <goffi@goffi.org>
parents: 945
diff changeset
136 whois_msg.append(_("Software version not available"))
91836a647515 plugin XEP-0092: use of checkFeature instead of hasFeature + timeout + message adapted to failure if software version is not available
Goffi <goffi@goffi.org>
parents: 945
diff changeset
137 else:
91836a647515 plugin XEP-0092: use of checkFeature instead of hasFeature + timeout + message adapted to failure if software version is not available
Goffi <goffi@goffi.org>
parents: 945
diff changeset
138 whois_msg.append(_("Client software version request timeout"))
926
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
139
4066
e75827204fe0 plugin XEP-0092: use `client` instead of `profile_key` in `version_get`
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
140 d = self.version_get(client, target_jid)
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
141 d.addCallbacks(version_cb, version_eb)
926
d609581bf74a plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents: 920
diff changeset
142 return d