Changeset 8683 for branches/gajim_0.11.1/src/common
- Timestamp:
- 08/31/07 19:22:58 (15 months ago)
- Location:
- branches/gajim_0.11.1/src/common
- Files:
-
- 4 modified
-
connection.py (modified) (2 diffs)
-
contacts.py (modified) (3 diffs)
-
zeroconf/connection_handlers_zeroconf.py (modified) (4 diffs)
-
zeroconf/connection_zeroconf.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11.1/src/common/connection.py
r8676 r8683 700 700 701 701 def send_message(self, jid, msg, keyID, type = 'chat', subject='', 702 chatstate = None, msg_id = None, composing_ jep = None, resource = None,702 chatstate = None, msg_id = None, composing_xep = None, resource = None, 703 703 user_nick = None, xhtml = None): 704 704 if not self.connection: … … 754 754 # tag is the active event 755 755 if chatstate is not None: 756 if (composing_ jep == 'JEP-0085' or not composing_jep) and \757 composing_ jep != 'asked_once':758 # JEP-0085756 if (composing_xep == 'XEP-0085' or not composing_xep) and \ 757 composing_xep != 'asked_once': 758 # XEP-0085 759 759 msg_iq.setTag(chatstate, namespace = common.xmpp.NS_CHATSTATES) 760 if composing_ jep in ('JEP-0022', 'asked_once') or not composing_jep:761 # JEP-0022760 if composing_xep in ('XEP-0022', 'asked_once') or not composing_xep: 761 # XEP-0022 762 762 chatstate_node = msg_iq.setTag('x', 763 763 namespace = common.xmpp.NS_EVENT) -
branches/gajim_0.11.1/src/common/contacts.py
r8661 r8683 21 21 def __init__(self, jid='', name='', groups=[], show='', status='', sub='', 22 22 ask='', resource='', priority=0, keyID='', our_chatstate=None, 23 chatstate=None, last_status_time=None, msg_id = None, composing_ jep = None):23 chatstate=None, last_status_time=None, msg_id = None, composing_xep = None): 24 24 self.jid = jid 25 25 self.name = name … … 44 44 self.msg_id = msg_id 45 45 # tell which JEP we're using for composing state 46 # None = have to ask, JEP-0022 = use this jep,47 # JEP-0085 = use this jep, False = no composing support48 self.composing_ jep = composing_jep46 # None = have to ask, XEP-0022 = use this jep, 47 # XEP-0085 = use this jep, False = no composing support 48 self.composing_xep = composing_xep 49 49 # this is contact's chatstate 50 50 self.chatstate = chatstate … … 145 145 def create_contact(self, jid='', name='', groups=[], show='', status='', 146 146 sub='', ask='', resource='', priority=0, keyID='', our_chatstate=None, 147 chatstate=None, last_status_time=None, composing_ jep=None):147 chatstate=None, last_status_time=None, composing_xep=None): 148 148 return Contact(jid, name, groups, show, status, sub, ask, resource, 149 149 priority, keyID, our_chatstate, chatstate, last_status_time, 150 composing_ jep)150 composing_xep) 151 151 152 152 def copy_contact(self, contact): -
branches/gajim_0.11.1/src/common/zeroconf/connection_handlers_zeroconf.py
r7568 r8683 652 652 delayed = msg.getTag('x', namespace = common.xmpp.NS_DELAY) != None 653 653 msg_id = None 654 composing_ jep = None654 composing_xep = None 655 655 xtags = msg.getTags('x') 656 656 # chatstates - look for chatstate tags in a message if not delayed 657 657 if not delayed: 658 composing_ jep = False658 composing_xep = False 659 659 children = msg.getChildren() 660 660 for child in children: 661 661 if child.getNamespace() == 'http://jabber.org/protocol/chatstates': 662 662 chatstate = child.getName() 663 composing_ jep = 'JEP-0085'663 composing_xep = 'XEP-0085' 664 664 break 665 665 # No JEP-0085 support, fallback to JEP-0022 … … 668 668 if chatstate_child: 669 669 chatstate = 'active' 670 composing_ jep = 'JEP-0022'670 composing_xep = 'XEP-0022' 671 671 if not msgtxt and chatstate_child.getTag('composing'): 672 672 chatstate = 'composing' … … 704 704 subject = subject) 705 705 self.dispatch('MSG', (frm, msgtxt, tim, encrypted, mtype, subject, 706 chatstate, msg_id, composing_ jep, user_nick, msghtml))706 chatstate, msg_id, composing_xep, user_nick, msghtml)) 707 707 elif mtype == 'normal': # it's single message 708 708 if self.name not in no_log_for and jid not in no_log_for and msgtxt: … … 711 711 if invite: 712 712 self.dispatch('MSG', (frm, msgtxt, tim, encrypted, 'normal', 713 subject, chatstate, msg_id, composing_ jep, user_nick))713 subject, chatstate, msg_id, composing_xep, user_nick)) 714 714 # END messageCB 715 715 -
branches/gajim_0.11.1/src/common/zeroconf/connection_zeroconf.py
r8653 r8683 346 346 347 347 def send_message(self, jid, msg, keyID, type = 'chat', subject='', 348 chatstate = None, msg_id = None, composing_ jep = None, resource = None,348 chatstate = None, msg_id = None, composing_xep = None, resource = None, 349 349 user_nick = None): 350 350 fjid = jid … … 394 394 # tag is the active event 395 395 if chatstate is not None: 396 if composing_ jep == 'JEP-0085' or not composing_jep:396 if composing_xep == 'XEP-0085' or not composing_xep: 397 397 # JEP-0085 398 398 msg_iq.setTag(chatstate, namespace = common.xmpp.NS_CHATSTATES) 399 if composing_ jep == 'JEP-0022' or not composing_jep:399 if composing_xep == 'XEP-0022' or not composing_xep: 400 400 # JEP-0022 401 401 chatstate_node = msg_iq.setTag('x', namespace = common.xmpp.NS_EVENT)
