comparison libpurple/protocols/jabber/buddy.c @ 27323:f92e2fdfeda4

Remove the gigantic ifdef'd-out "Show buddy features" sections These have been commented out forever and I hate having to scroll back and forth across them when dealing with this function.
author Paul Aurich <paul@darkrain42.org>
date Sun, 05 Jul 2009 05:01:05 +0000
parents ea9df9bfa921
children 77fc855ed8b7
comparison
equal deleted inserted replaced
27311:319b0f3dd2d0 27323:f92e2fdfeda4
721 g_free(tmp); 721 g_free(tmp);
722 g_free(purdy); 722 g_free(purdy);
723 } else { 723 } else {
724 purple_notify_user_info_prepend_pair(user_info, _("Status"), _("Unknown")); 724 purple_notify_user_info_prepend_pair(user_info, _("Status"), _("Unknown"));
725 } 725 }
726 #if 0
727 /* #if 0 this for now; I think this would be far more useful if we limited this to a particular set of features
728 * of particular interest (-vv jumps out as one). As it is now, I don't picture people getting all excited: "Oh sweet crap!
729 * So-and-so supports 'jabber:x:data' AND 'Collaborative Data Objects'!"
730 */
731
732 if(jbr && jbr->caps) {
733 GString *tmp = g_string_new("");
734 GList *iter;
735 for(iter = jbr->caps->features; iter; iter = g_list_next(iter)) {
736 const char *feature = iter->data;
737
738 if(!strcmp(feature, "jabber:iq:last"))
739 feature = _("Last Activity");
740 else if(!strcmp(feature, "http://jabber.org/protocol/disco#info"))
741 feature = _("Service Discovery Info");
742 else if(!strcmp(feature, "http://jabber.org/protocol/disco#items"))
743 feature = _("Service Discovery Items");
744 else if(!strcmp(feature, "http://jabber.org/protocol/address"))
745 feature = _("Extended Stanza Addressing");
746 else if(!strcmp(feature, "http://jabber.org/protocol/muc"))
747 feature = _("Multi-User Chat");
748 else if(!strcmp(feature, "http://jabber.org/protocol/muc#user"))
749 feature = _("Multi-User Chat Extended Presence Information");
750 else if(!strcmp(feature, "http://jabber.org/protocol/ibb"))
751 feature = _("In-Band Bytestreams");
752 else if(!strcmp(feature, "http://jabber.org/protocol/commands"))
753 feature = _("Ad-Hoc Commands");
754 else if(!strcmp(feature, "http://jabber.org/protocol/pubsub"))
755 feature = _("PubSub Service");
756 else if(!strcmp(feature, "http://jabber.org/protocol/bytestreams"))
757 feature = _("SOCKS5 Bytestreams");
758 else if(!strcmp(feature, "jabber:x:oob"))
759 feature = _("Out of Band Data");
760 else if(!strcmp(feature, "http://jabber.org/protocol/xhtml-im"))
761 feature = _("XHTML-IM");
762 else if(!strcmp(feature, "jabber:iq:register"))
763 feature = _("In-Band Registration");
764 else if(!strcmp(feature, "http://jabber.org/protocol/geoloc"))
765 feature = _("User Location");
766 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0084.html"))
767 feature = _("User Avatar");
768 else if(!strcmp(feature, "http://jabber.org/protocol/chatstates"))
769 feature = _("Chat State Notifications");
770 else if(!strcmp(feature, "jabber:iq:version"))
771 feature = _("Software Version");
772 else if(!strcmp(feature, "http://jabber.org/protocol/si"))
773 feature = _("Stream Initiation");
774 else if(!strcmp(feature, "http://jabber.org/protocol/si/profile/file-transfer"))
775 feature = _("File Transfer");
776 else if(!strcmp(feature, "http://jabber.org/protocol/mood"))
777 feature = _("User Mood");
778 else if(!strcmp(feature, "http://jabber.org/protocol/activity"))
779 feature = _("User Activity");
780 else if(!strcmp(feature, "http://jabber.org/protocol/caps"))
781 feature = _("Entity Capabilities");
782 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0116.html"))
783 feature = _("Encrypted Session Negotiations");
784 else if(!strcmp(feature, "http://jabber.org/protocol/tune"))
785 feature = _("User Tune");
786 else if(!strcmp(feature, "http://jabber.org/protocol/rosterx"))
787 feature = _("Roster Item Exchange");
788 else if(!strcmp(feature, "http://jabber.org/protocol/reach"))
789 feature = _("Reachability Address");
790 else if(!strcmp(feature, "http://jabber.org/protocol/profile"))
791 feature = _("User Profile");
792 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0166.html#ns"))
793 feature = _("Jingle");
794 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0167.html#ns"))
795 feature = _("Jingle Audio");
796 else if(!strcmp(feature, "http://jabber.org/protocol/nick"))
797 feature = _("User Nickname");
798 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0176.html#ns-udp"))
799 feature = _("Jingle ICE UDP");
800 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0176.html#ns-tcp"))
801 feature = _("Jingle ICE TCP");
802 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0177.html#ns"))
803 feature = _("Jingle Raw UDP");
804 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0180.html#ns"))
805 feature = _("Jingle Video");
806 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0181.html#ns"))
807 feature = _("Jingle DTMF");
808 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0184.html#ns"))
809 feature = _("Message Receipts");
810 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0189.html#ns"))
811 feature = _("Public Key Publishing");
812 else if(!strcmp(feature, "http://jabber.org/protocol/chatting"))
813 feature = _("User Chatting");
814 else if(!strcmp(feature, "http://jabber.org/protocol/browsing"))
815 feature = _("User Browsing");
816 else if(!strcmp(feature, "http://jabber.org/protocol/gaming"))
817 feature = _("User Gaming");
818 else if(!strcmp(feature, "http://jabber.org/protocol/viewing"))
819 feature = _("User Viewing");
820 else if(!strcmp(feature, "urn:xmpp:ping"))
821 feature = _("Ping");
822 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0200.html#ns"))
823 feature = _("Stanza Encryption");
824 else if(!strcmp(feature, "urn:xmpp:time"))
825 feature = _("Entity Time");
826 else if(!strcmp(feature, "urn:xmpp:delay"))
827 feature = _("Delayed Delivery");
828 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0204.html#ns"))
829 feature = _("Collaborative Data Objects");
830 else if(!strcmp(feature, "http://jabber.org/protocol/fileshare"))
831 feature = _("File Repository and Sharing");
832 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0215.html#ns"))
833 feature = _("STUN Service Discovery for Jingle");
834 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0116.html#ns"))
835 feature = _("Simplified Encrypted Session Negotiation");
836 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0219.html#ns"))
837 feature = _("Hop Check");
838 else if(g_str_has_suffix(feature, "+notify"))
839 feature = NULL;
840 if(feature)
841 g_string_append_printf(tmp, "%s<br/>", feature);
842 }
843
844 if(strlen(tmp->str) > 0)
845 purple_notify_user_info_prepend_pair(user_info, _("Capabilities"), tmp->str);
846
847 g_string_free(tmp, TRUE);
848 }
849 #endif
850 } else { 726 } else {
851 gboolean multiple_resources = jbi->jb->resources && jbi->jb->resources->next; 727 gboolean multiple_resources = jbi->jb->resources && jbi->jb->resources->next;
852 728
853 for(resources = jbi->jb->resources; resources; resources = resources->next) { 729 for(resources = jbi->jb->resources; resources; resources = resources->next) {
854 char *purdy = NULL; 730 char *purdy = NULL;
919 g_free(tmp); 795 g_free(tmp);
920 } 796 }
921 797
922 if(jbr->name) 798 if(jbr->name)
923 purple_notify_user_info_prepend_pair(user_info, _("Resource"), jbr->name); 799 purple_notify_user_info_prepend_pair(user_info, _("Resource"), jbr->name);
924 #if 0
925 if(jbr && jbr->caps) {
926 GString *tmp = g_string_new("");
927 GList *iter;
928 for(iter = jbr->caps->features; iter; iter = g_list_next(iter)) {
929 const char *feature = iter->data;
930
931 if(!strcmp(feature, "jabber:iq:last"))
932 feature = _("Last Activity");
933 else if(!strcmp(feature, "http://jabber.org/protocol/disco#info"))
934 feature = _("Service Discovery Info");
935 else if(!strcmp(feature, "http://jabber.org/protocol/disco#items"))
936 feature = _("Service Discovery Items");
937 else if(!strcmp(feature, "http://jabber.org/protocol/address"))
938 feature = _("Extended Stanza Addressing");
939 else if(!strcmp(feature, "http://jabber.org/protocol/muc"))
940 feature = _("Multi-User Chat");
941 else if(!strcmp(feature, "http://jabber.org/protocol/muc#user"))
942 feature = _("Multi-User Chat Extended Presence Information");
943 else if(!strcmp(feature, "http://jabber.org/protocol/ibb"))
944 feature = _("In-Band Bytestreams");
945 else if(!strcmp(feature, "http://jabber.org/protocol/commands"))
946 feature = _("Ad-Hoc Commands");
947 else if(!strcmp(feature, "http://jabber.org/protocol/pubsub"))
948 feature = _("PubSub Service");
949 else if(!strcmp(feature, "http://jabber.org/protocol/bytestreams"))
950 feature = _("SOCKS5 Bytestreams");
951 else if(!strcmp(feature, "jabber:x:oob"))
952 feature = _("Out of Band Data");
953 else if(!strcmp(feature, "http://jabber.org/protocol/xhtml-im"))
954 feature = _("XHTML-IM");
955 else if(!strcmp(feature, "jabber:iq:register"))
956 feature = _("In-Band Registration");
957 else if(!strcmp(feature, "http://jabber.org/protocol/geoloc"))
958 feature = _("User Location");
959 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0084.html"))
960 feature = _("User Avatar");
961 else if(!strcmp(feature, "http://jabber.org/protocol/chatstates"))
962 feature = _("Chat State Notifications");
963 else if(!strcmp(feature, "jabber:iq:version"))
964 feature = _("Software Version");
965 else if(!strcmp(feature, "http://jabber.org/protocol/si"))
966 feature = _("Stream Initiation");
967 else if(!strcmp(feature, "http://jabber.org/protocol/si/profile/file-transfer"))
968 feature = _("File Transfer");
969 else if(!strcmp(feature, "http://jabber.org/protocol/mood"))
970 feature = _("User Mood");
971 else if(!strcmp(feature, "http://jabber.org/protocol/activity"))
972 feature = _("User Activity");
973 else if(!strcmp(feature, "http://jabber.org/protocol/caps"))
974 feature = _("Entity Capabilities");
975 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0116.html"))
976 feature = _("Encrypted Session Negotiations");
977 else if(!strcmp(feature, "http://jabber.org/protocol/tune"))
978 feature = _("User Tune");
979 else if(!strcmp(feature, "http://jabber.org/protocol/rosterx"))
980 feature = _("Roster Item Exchange");
981 else if(!strcmp(feature, "http://jabber.org/protocol/reach"))
982 feature = _("Reachability Address");
983 else if(!strcmp(feature, "http://jabber.org/protocol/profile"))
984 feature = _("User Profile");
985 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0166.html#ns"))
986 feature = _("Jingle");
987 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0167.html#ns"))
988 feature = _("Jingle Audio");
989 else if(!strcmp(feature, "http://jabber.org/protocol/nick"))
990 feature = _("User Nickname");
991 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0176.html#ns-udp"))
992 feature = _("Jingle ICE UDP");
993 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0176.html#ns-tcp"))
994 feature = _("Jingle ICE TCP");
995 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0177.html#ns"))
996 feature = _("Jingle Raw UDP");
997 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0180.html#ns"))
998 feature = _("Jingle Video");
999 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0181.html#ns"))
1000 feature = _("Jingle DTMF");
1001 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0184.html#ns"))
1002 feature = _("Message Receipts");
1003 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0189.html#ns"))
1004 feature = _("Public Key Publishing");
1005 else if(!strcmp(feature, "http://jabber.org/protocol/chatting"))
1006 feature = _("User Chatting");
1007 else if(!strcmp(feature, "http://jabber.org/protocol/browsing"))
1008 feature = _("User Browsing");
1009 else if(!strcmp(feature, "http://jabber.org/protocol/gaming"))
1010 feature = _("User Gaming");
1011 else if(!strcmp(feature, "http://jabber.org/protocol/viewing"))
1012 feature = _("User Viewing");
1013 else if(!strcmp(feature, "urn:xmpp:ping"))
1014 feature = _("Ping");
1015 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0200.html#ns"))
1016 feature = _("Stanza Encryption");
1017 else if(!strcmp(feature, "urn:xmpp:time"))
1018 feature = _("Entity Time");
1019 else if(!strcmp(feature, "urn:xmpp:delay"))
1020 feature = _("Delayed Delivery");
1021 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0204.html#ns"))
1022 feature = _("Collaborative Data Objects");
1023 else if(!strcmp(feature, "http://jabber.org/protocol/fileshare"))
1024 feature = _("File Repository and Sharing");
1025 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0215.html#ns"))
1026 feature = _("STUN Service Discovery for Jingle");
1027 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0116.html#ns"))
1028 feature = _("Simplified Encrypted Session Negotiation");
1029 else if(!strcmp(feature, "http://www.xmpp.org/extensions/xep-0219.html#ns"))
1030 feature = _("Hop Check");
1031 else if(g_str_has_suffix(feature, "+notify"))
1032 feature = NULL;
1033
1034 if(feature)
1035 g_string_append_printf(tmp, "%s\n", feature);
1036 }
1037 if(strlen(tmp->str) > 0)
1038 purple_notify_user_info_prepend_pair(user_info, _("Capabilities"), tmp->str);
1039
1040 g_string_free(tmp, TRUE);
1041 }
1042 #endif
1043 } 800 }
1044 } 801 }
1045 802
1046 if (!jbi->jb->resources) { 803 if (!jbi->jb->resources) {
1047 /* the buddy is offline */ 804 /* the buddy is offline */