Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dax/jmc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/jmc/model/account.py')
-rw-r--r--src/jmc/model/account.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/jmc/model/account.py b/src/jmc/model/account.py
index ce32b7a..29b2470 100644
--- a/src/jmc/model/account.py
+++ b/src/jmc/model/account.py
@@ -142,6 +142,10 @@ class MYPOP3_SSL(poplib.POP3_SSL):
self._debugging = 0
self.welcome = self._getresp()
+def _get_default_status_msg(self, lang_class):
+ return self.get_type() + "://" + self.login + "@" + self.host + ":" + \
+ unicode(self.port)
+
class MailAccount(PresenceAccount):
""" Wrapper to mail connection and action.
Abstract class, do not represent real mail connection type.
@@ -240,6 +244,8 @@ class MailAccount(PresenceAccount):
get_presence_actions_fields = classmethod(_get_presence_actions_fields)
+ get_default_status_msg = _get_default_status_msg
+
def set_status(self, status):
"""Set current Jabber status"""
@@ -323,10 +329,6 @@ class MailAccount(PresenceAccount):
def format_message_summary(self, email_msg):
return self.format_message(email_msg, False)
- def get_default_status_msg(self, lang_class):
- return self.get_type() + "://" + self.login + "@" + self.host + ":" + \
- unicode(self.port)
-
def connect(self):
raise NotImplementedError
@@ -782,6 +784,15 @@ class SMTPAccount(Account):
get_register_fields = classmethod(_get_register_fields)
+ get_default_status_msg = _get_default_status_msg
+
+ def get_type(self):
+ if self.tls:
+ return "smtps"
+ return "smtp"
+
+ type = property(get_type)
+
def create_email(self, from_email, to_email, subject, body, other_headers=None):
"""Create new email"""
_email = MIMEText(body)