Mercurial > libervia-backend
annotate frontends/src/quick_frontend/quick_gateways.py @ 487:e789917fb59d
core: added isJidInRoster method
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 17 Aug 2012 03:07:49 +0200 |
parents | 2a072735e459 |
children | ca13633d3b6b |
rev | line source |
---|---|
173 | 1 #!/usr/bin/python |
2 # -*- coding: utf-8 -*- | |
3 | |
4 """ | |
5 helper class for making a SAT frontend | |
459 | 6 Copyright (C) 2009, 2010, 2011, 2012 Jérôme Poisson (goffi@goffi.org) |
173 | 7 |
8 This program is free software: you can redistribute it and/or modify | |
480
2a072735e459
Licence modification: the full project is now under AGPL v3+ instead of GPL v3+
Goffi <goffi@goffi.org>
parents:
459
diff
changeset
|
9 it under the terms of the GNU Affero General Public License as published by |
173 | 10 the Free Software Foundation, either version 3 of the License, or |
11 (at your option) any later version. | |
12 | |
13 This program is distributed in the hope that it will be useful, | |
14 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
480
2a072735e459
Licence modification: the full project is now under AGPL v3+ instead of GPL v3+
Goffi <goffi@goffi.org>
parents:
459
diff
changeset
|
16 GNU Affero General Public License for more details. |
173 | 17 |
480
2a072735e459
Licence modification: the full project is now under AGPL v3+ instead of GPL v3+
Goffi <goffi@goffi.org>
parents:
459
diff
changeset
|
18 You should have received a copy of the GNU Affero General Public License |
173 | 19 along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 """ | |
21 | |
22 | |
23 | |
24 | |
25 class QuickGatewaysManager(): | |
26 | |
27 | |
28 def __init__(self, host, gateways, title=_("Gateways manager"), server=None): | |
29 self.WARNING_MSG = _(u"""Be careful ! Gateways allow you to use an external IM (legacy IM), so you can see your contact as jabber contacts. | |
30 But when you do this, all your messages go throught the external legacy IM server, it is a huge privacy issue (i.e.: all your messages throught the gateway can be monitored, recorded, analyzed by the external server, most of time a private company).""") | |
31 self.host = host | |
32 | |
33 def getGatewayDesc(self, gat_type): | |
34 """Return a human readable description of gateway type | |
35 @param gat_type: type of gateway, as given by SàT""" | |
36 desc = _('Unknown IM') | |
37 | |
38 if gat_type == 'irc': | |
39 desc = "Internet Relay Chat" | |
40 elif gat_type == 'xmpp': | |
41 desc = "XMPP" | |
42 elif gat_type == 'qq': | |
43 desc = "Tencent QQ" | |
44 elif gat_type == 'simple': | |
45 desc = "SIP/SIMPLE" | |
46 elif gat_type == 'icq': | |
47 desc = "ICQ" | |
48 elif gat_type == 'yahoo': | |
49 desc = "Yahoo! Messenger" | |
50 elif gat_type == 'gadu-gadu': | |
51 desc = "Gadu-Gadu" | |
52 elif gat_type == 'aim': | |
53 desc = "AOL Instant Messenger" | |
54 elif gat_type == 'msn': | |
55 desc = 'Windows Live Messenger' | |
56 | |
57 return desc |