Changeset 9567
- Timestamp:
- 05/03/08 18:52:27 (7 months ago)
- Location:
- branches/session_centric/src
- Files:
-
- 4 modified
-
common/connection_handlers.py (modified) (2 diffs)
-
common/zeroconf/connection_handlers_zeroconf.py (modified) (2 diffs)
-
roster_window.py (modified) (7 diffs)
-
session.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/session_centric/src/common/connection_handlers.py
r9560 r9567 1559 1559 return 1560 1560 elif mtype != 'groupchat': 1561 session = self.get_ session(frm, thread_id, mtype)1561 session = self.get_or_create_session(frm, thread_id, mtype) 1562 1562 1563 1563 if thread_id and not session.received_thread_id: … … 1732 1732 is_continued)) 1733 1733 1734 def get_ session(self, jid, thread_id, type):1734 def get_or_create_session(self, jid, thread_id, type): 1735 1735 '''returns an existing session between this connection and 'jid', returns a new one if none exist.''' 1736 1736 session = self.find_session(jid, thread_id, type) -
branches/session_centric/src/common/zeroconf/connection_handlers_zeroconf.py
r9299 r9567 659 659 jid = frm 660 660 661 session = self.get_ session(frm, thread_id, mtype)661 session = self.get_or_create_session(frm, thread_id, mtype) 662 662 663 663 if thread_id and not session.received_thread_id: … … 795 795 raise common.xmpp.NodeProcessed 796 796 797 def get_ session(self, jid, thread_id, type):797 def get_or_create_session(self, jid, thread_id, type): 798 798 '''returns an existing session between this connection and 'jid', returns a new one if none exist.''' 799 799 session = self.find_session(jid, thread_id, type) -
branches/session_centric/src/roster_window.py
r9560 r9567 56 56 from groupchat_control import GroupchatControl 57 57 from groupchat_control import PrivateChatControl 58 59 from session import ChatControlSession 58 60 59 61 from common import dbus_support … … 3391 3393 if gajim.single_click and not event.state & gtk.gdk.SHIFT_MASK and \ 3392 3394 not event.state & gtk.gdk.CONTROL_MASK: 3393 # Don't handle d ubble click if we press icon of a metacontact3395 # Don't handle double click if we press icon of a metacontact 3394 3396 iter = model.get_iter(path) 3395 3397 if x > x_min and x < x_min + 27 and type_ == 'contact' and \ … … 3929 3931 3930 3932 if not session: 3931 session = gajim.connections[account].get_ session(fjid, None, 'pm')3933 session = gajim.connections[account].get_or_create_session(fjid, None, 'pm') 3932 3934 3933 3935 chat_control = PrivateChatControl(mw, gc_contact, contact, account, session) … … 3968 3970 resource = resource) 3969 3971 3970 session = gajim.connections[account].get_ session(fjid, None, 'chat')3972 session = gajim.connections[account].get_or_create_session(fjid, None, 'chat') 3971 3973 3972 3974 if not gajim.interface.msg_win_mgr.has_window(fjid, account): … … 4315 4317 conn = gajim.connections[account] 4316 4318 4319 if not session and fjid in conn.sessions: 4320 sessions = filter(lambda s: isinstance(s, ChatControlSession), 4321 conn.sessions[fjid].values()) 4322 4323 # look for an existing session with a chat control 4324 for s in sessions: 4325 if s.control: 4326 session = s 4327 break 4328 4329 if not session and not len(sessions) == 0: 4330 # there are no sessions with chat controls, just take the first one 4331 session = sessions[0] 4332 4317 4333 if not session: 4318 session = conn.get_session(fjid, None, 'chat') 4334 # couldn't find an existing ChatControlSession, just make a new one 4335 session = conn.make_new_session(fjid, None, 'chat') 4319 4336 4320 4337 if not session.control: 4338 # open a new chat control 4321 4339 session.control = self.new_chat(session, contact, account, resource=resource) 4322 4340 … … 4337 4355 4338 4356 def on_row_activated(self, widget, path): 4339 '''When an iter is activated (d ubblick or single click if gnome is set4340 this way'''4357 '''When an iter is activated (double-click or single click if gnome is 4358 set this way''' 4341 4359 model = self.tree.get_model() 4342 4360 account = model[path][C_ACCOUNT].decode('utf-8') … … 4385 4403 if jid == gajim.get_jid_from_account(account): 4386 4404 resource = c.resource 4405 4387 4406 self.on_open_chat_window(widget, c, account, resource = resource, session = session) 4388 4407 -
branches/session_centric/src/session.py
r9560 r9567 19 19 20 20 self.control = None 21 22 def acknowledge_termination(self): 23 # the other party terminated the session. we'll keep the control around, though. 24 stanza_session.EncryptedStanzaSession.acknowledge_termination(self) 25 26 self.control.session = None 21 27 22 28 # remove events associated with this session from the queue
