Changeset 9585 for trunk/src/common/pep.py
- Timestamp:
- 05/05/08 23:55:59 (7 months ago)
- Files:
-
- 1 modified
-
trunk/src/common/pep.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/pep.py
r9580 r9585 225 225 del contact.activity['text'] 226 226 227 def user_nickname(items, name, jid): 228 has_child = False 229 retract = False 230 nick = None 231 232 for item in items.getTags('item'): 233 child = item.getTag('nick') 234 if child is not None: 235 has_child = True 236 nick = child.getData() 237 break 238 239 if items.getTag('retract') is not None: 240 retract = True 241 242 if jid == gajim.get_jid_from_account(name): 243 if has_child: 244 gajim.nicks[name] = nick 245 if retract: 246 gajim.nicks[name] = gajim.config.get_per('accounts', name, 'name') 247 248 (user, resource) = gajim.get_room_and_nick_from_fjid(jid) 249 contact = gajim.contacts.get_contact(name, user, resource=resource) 250 if not contact: 251 return 252 if has_child: 253 if nick is not None: 254 contact.contact_name = nick 255 gajim.interface.roster.draw_contact(user, name) 256 ctrl = gajim.interface.msg_win_mgr.get_control(user, name) 257 if ctrl: 258 ctrl.update_ui() 259 win = gajim.interface.msg_win_mgr.get_window(user, name) 260 win.redraw_tab(ctrl) 261 win.show_title() 262 elif retract: 263 contact.contact_name = '' 264 227 265 def user_send_mood(account, mood, message = ''): 228 266 if not gajim.config.get('publish_mood'): … … 276 314 gajim.connections[account].send_pb_publish('', xmpp.NS_TUNE, item, '0') 277 315 316 def user_send_nickname(account, nick): 317 if not (gajim.config.get('publish_nick') and \ 318 gajim.connections[account].pep_supported): 319 return 320 item = xmpp.Node('nick', {'xmlns': xmpp.NS_NICK}) 321 item.addData(nick) 322 323 gajim.connections[account].send_pb_publish('', xmpp.NS_NICK, item, '0') 324 278 325 def user_retract_mood(account): 279 326 gajim.connections[account].send_pb_retract('', xmpp.NS_MOOD, '0') … … 284 331 def user_retract_tune(account): 285 332 gajim.connections[account].send_pb_retract('', xmpp.NS_TUNE, '0') 333 334 def user_retract_nickname(account): 335 gajim.connections[account].send_pb_retract('', xmpp.NS_NICK, '0')
