Changeset 2994 for trunk/jmessenger/js/trophyim.js
- Timestamp:
- 07/05/10 15:52:19 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jmessenger/js/trophyim.js
r2990 r2994 594 594 group_array[group_array.length] = groups[g].firstChild.nodeValue; 595 595 } 596 597 if( getAttribute('ask') ) 598 TrophyIM.rosterObj.addContact(getAttribute('jid'), getAttribute('ask'), getAttribute('name'), group_array); 596 597 if( getAttribute('ask') && getAttribute('ask').toString() === "subscribe" ) 598 { 599 if( getAttribute('subscription').toString() === "none" ) 600 { 601 TrophyIM.rosterObj.addContact( getAttribute('jid'), getAttribute('ask'), getAttribute('name'), group_array ); 602 } 603 604 if( getAttribute('subscription').toString() === "remove" ) 605 { 606 TrophyIM.rosterObj.removeContact(getAttribute('jid')); 607 } 608 } 599 609 else 600 TrophyIM.rosterObj.addContact(getAttribute('jid'), getAttribute('subscription'), getAttribute('name'), group_array); 610 { 611 if( getAttribute('subscription').toString() === "remove" ) 612 { 613 TrophyIM.rosterObj.removeContact(getAttribute('jid')); 614 } 615 else 616 { 617 TrophyIM.rosterObj.addContact( getAttribute('jid'), getAttribute('subscription'), getAttribute('name'), group_array ); 618 } 619 } 601 620 } 602 621 } … … 1246 1265 case "from" : 1247 1266 1248 status = " (( " + i18n.AUTH _ASK+ " )) ";1267 status = " (( " + i18n.AUTHORIZED + " )) "; 1249 1268 statusColor = "green"; 1250 1269 break; … … 1260 1279 status = " (( " + i18n.ASK_FOR_AUTH_QUESTION + " )) "; 1261 1280 statusColor = "orange"; 1281 break; 1282 1283 default : 1284 1262 1285 break; 1263 1286 } … … 1397 1420 var _subscription = TrophyIM.rosterObj.roster[users[i]].contact.subscription; 1398 1421 1399 if( _subscription == "to" || _subscription == "not-in-roster") 1422 if( _subscription === "to" ) 1423 { 1424 flag = true; 1425 } 1426 1427 if( _subscription === "not-in-roster") 1400 1428 { 1401 1429 flag = true; … … 1458 1486 var _id = TrophyIM.connection.getUniqueId(); 1459 1487 1460 TrophyIM.connection.send($pres( ).attrs( {to: jidTo, from: jidFrom, type: _typeSubscription, id: _id}).tree());1488 TrophyIM.connection.send($pres( ).attrs({ from: jidFrom, to: jidTo, type: _typeSubscription, id: _id }).tree()); 1461 1489 }, 1462 1490 … … 1696 1724 this.addContact = function(jid, subscription, name, groups ) 1697 1725 { 1698 switch( subscription ) 1699 { 1700 case 'remove' : 1701 1702 this.removeContact(jid); 1703 break; 1704 1705 default : 1706 1707 var contact = { jid:jid, subscription:subscription, name:name, groups:groups } 1708 var jid_lower = jid.toLowerCase(); 1709 1710 if ( this.roster[jid_lower] ) 1711 { 1712 this.roster[jid_lower]['contact'] = contact; 1713 } 1714 else 1715 { 1716 this.roster[jid_lower] = {contact:contact}; 1717 } 1718 1719 groups = groups ? groups : ['']; 1720 1721 for ( var g = 0; g < groups.length; g++ ) 1722 { 1723 if ( !this.groups[groups[g]] ) 1724 { 1725 this.groups[groups[g]] = {}; 1726 } 1727 1728 this.groups[groups[g]][jid_lower] = jid_lower; 1729 } 1730 } 1731 1732 /*if( subscription.indexOf("remove") >= 0 ) 1726 if( subscription === "remove" ) 1733 1727 { 1734 1728 this.removeContact(jid); … … 1759 1753 this.groups[groups[g]][jid_lower] = jid_lower; 1760 1754 } 1761 } */1755 } 1762 1756 } 1763 1757
Note: See TracChangeset
for help on using the changeset viewer.