- Timestamp:
- 07/05/10 15:52:19 (14 years ago)
- Location:
- trunk/jmessenger/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jmessenger/js/AddUser.js
r2990 r2994 79 79 if( jidFrom != jidTo ) 80 80 { 81 TrophyIM.rosterObj.removeContact( jidTo ); 82 81 83 // Remove Element 82 84 loadscript.removeElement( getElement('itenContact_' + jidTo ) ); 83 85 loadscript.removeElement( getElement('span_show_itenContact_' + jidTo ) ); 84 86 loadscript.removeElement( getElement('itenContactNotification_' + jidTo ) ); 85 86 TrophyIM.rosterObj.removeContact( jidTo );87 87 88 88 TrophyIM.addContact( jidTo, name, group ); -
trunk/jmessenger/js/jscode/loadIM.js
r2988 r2994 878 878 switch(subscription) 879 879 { 880 case 'from': 880 case 'from': 881 case 'subscribe' : 882 883 TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed'); 884 break; 885 886 case 'none' : 881 887 882 888 TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe'); 889 //TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed'); 883 890 break; 884 885 case 'none' :886 891 887 TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe'); 892 case 'to' : 893 888 894 TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed'); 889 895 removeElement( getElement('itenContactNotification_' + jidTo ) ); 890 896 break; 891 897 892 898 case 'not-in-roster': 893 899 894 setTimeout(function()900 /*setTimeout(function() 895 901 { 896 902 var _add = ""; … … 901 907 } 902 908 903 },100); 909 },100);*/ 910 911 addUser.add( jidTo ); 904 912 905 913 break; 906 914 907 case 'to' : 908 909 TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed'); 910 911 removeElement( getElement('itenContactNotification_' + jidTo ) ); 915 default: 912 916 913 case 'subscribe' : 914 915 TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe'); 916 917 break; 917 alert( "EU NÃO SEI : " + subscription ); 918 918 } 919 919 } -
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.