Changeset 10354
- Timestamp:
- 08/30/08 03:31:25 (3 months ago)
- Location:
- trunk/src
- Files:
-
- 5 modified
-
chat_control.py (modified) (2 diffs)
-
common/config.py (modified) (1 diff)
-
common/connection_handlers.py (modified) (4 diffs)
-
common/connection.py (modified) (2 diffs)
-
common/stanza_session.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/chat_control.py
r10300 r10354 1531 1531 'status', '', None) 1532 1532 1533 loggable = gajim.config.get('log_encrypted_sessions') 1534 1533 1535 if self.session: 1534 self.session.loggable = gajim.config.get( 1535 'log_encrypted_sessions'); 1536 if self.session and not self.session.is_loggable(): 1536 self.session.loggable = loggable 1537 1538 loggable = self.session.is_loggable() 1539 else: 1540 loggable = loggable and gajim.config.should_log(self.account, 1541 self.contact.jid) 1542 1543 if loggable: 1544 msg = _('Session WILL be logged') 1545 else: 1537 1546 msg = _('Session WILL NOT be logged') 1538 else: 1539 msg = _('Session WILL be logged') 1547 1540 1548 ChatControlBase.print_conversation_line(self, msg, 1541 1549 'status', '', None) … … 1549 1557 1550 1558 self._show_lock_image(self.gpg_is_active, 'GPG', 1551 self.gpg_is_active, 1552 self.session and self.session.is_loggable(), True) 1559 self.gpg_is_active, loggable, True) 1553 1560 1554 1561 def _show_lock_image(self, visible, enc_type = '', enc_enabled = False, chat_logged = False, authenticated = False): -
trunk/src/common/config.py
r10295 r10354 643 643 return False 644 644 645 def should_log(self, account, jid): 646 '''should conversations between a local account and a remote jid be 647 logged?''' 648 no_log_for = self.get_per('accounts', account, 'no_log_for') 649 650 if not no_log_for: 651 no_log_for = '' 652 653 no_log_for = no_log_for.split() 654 655 return (account not in no_log_for) and (jid not in no_log_for) 656 645 657 def __init__(self): 646 658 #init default values -
trunk/src/common/connection_handlers.py
r10346 r10354 1842 1842 statusCode)) 1843 1843 1844 no_log_for = gajim.config.get_per('accounts', self.name, 'no_log_for')1845 1846 if not no_log_for:1847 no_log_for = ''1848 1849 no_log_for = no_log_for.split()1850 1844 tim_int = int(float(mktime(tim))) 1851 1852 if self.name not in no_log_for and jid not in no_log_for and not \ 1845 if gajim.config.should_log(self.name, jid) and not \ 1853 1846 tim_int <= self.last_history_time[jid] and msgtxt and frm.find('/') >= 0: 1854 1847 # if frm.find('/') < 0, it means message comes from room itself … … 1964 1957 transport_auto_auth = True 1965 1958 1966 no_log_for = gajim.config.get_per('accounts', self.name,1967 'no_log_for').split()1968 1959 status = prs.getStatus() or '' 1969 1960 show = prs.getShow() … … 2021 2012 errmsg, errcode)) 2022 2013 if not ptype or ptype == 'unavailable': 2023 if gajim.config.get('log_contact_status_changes') and self.name\2024 not in no_log_for and jid_stripped not in no_log_for:2014 if gajim.config.get('log_contact_status_changes') and \ 2015 gajim.config.should_log(self.name, jid_stripped): 2025 2016 gc_c = gajim.contacts.get_gc_contact(self.name, jid_stripped, 2026 2017 resource) … … 2150 2141 self.request_vcard(jid_stripped) 2151 2142 if not ptype or ptype == 'unavailable': 2152 if gajim.config.get('log_contact_status_changes') and self.name\2153 not in no_log_for and jid_stripped not in no_log_for:2143 if gajim.config.get('log_contact_status_changes') and \ 2144 gajim.config.should_log(self.name, jid_stripped): 2154 2145 try: 2155 2146 gajim.logger.write('status', jid_stripped, status, show) -
trunk/src/common/connection.py
r10250 r10354 1183 1183 msg_id = self.connection.send(msg_iq) 1184 1184 if not forward_from and session and session.is_loggable(): 1185 no_log_for = gajim.config.get_per('accounts', self.name, 'no_log_for')\1186 .split()1187 1185 ji = gajim.get_jid_without_resource(jid) 1188 if self.name not in no_log_for and ji not in no_log_for:1186 if gajim.config.should_log(self.name, ji): 1189 1187 log_msg = msg 1190 1188 if original_message != None: … … 1516 1514 if not self.last_history_time.has_key(room_jid): 1517 1515 # Not in memory, get it from DB 1518 no_log_for = gajim.config.get_per('accounts', self.name, 'no_log_for')\1519 .split()1520 1516 last_log = None 1521 1517 # Do not check if we are not logging for this room 1522 if self.name not in no_log_for and room_jid not in no_log_for:1518 if gajim.config.should_log(self.name, room_jid): 1523 1519 # Check time first in the FAST table 1524 1520 last_log = gajim.logger.get_room_last_message_time(room_jid) -
trunk/src/common/stanza_session.py
r10337 r10354 67 67 68 68 def is_loggable(self): 69 account = self.conn.name 70 no_log_for = gajim.config.get_per('accounts', account, 'no_log_for') 71 72 if not no_log_for: 73 no_log_for = '' 74 75 no_log_for = no_log_for.split() 76 77 return self.loggable and account not in no_log_for and self.jid not in no_log_for 69 return self.loggable and gajim.config.should_log(self.conn.name, self.jid) 78 70 79 71 # remove events associated with this session from the queue
