Mercurial > pidgin
comparison libpurple/protocols/oscar/oscar.c @ 30899:56e1f06471a9
Removed an abstruse Easter Egg from 869efa8a750e9eee235af2ec631e7554cb373778.
Mark says he's OK with it.
author | ivan.komarov@soc.pidgin.im |
---|---|
date | Tue, 02 Nov 2010 20:55:06 +0000 |
parents | a636aa086d0b |
children | f8f853ab3aba |
comparison
equal
deleted
inserted
replaced
30898:e9e41a04513d | 30899:56e1f06471a9 |
---|---|
71 | OSCAR_CAPABILITY_XTRAZ | 71 | OSCAR_CAPABILITY_XTRAZ |
72 | OSCAR_CAPABILITY_HTML_MSGS; | 72 | OSCAR_CAPABILITY_HTML_MSGS; |
73 | 73 |
74 static guint8 features_aim[] = {0x01, 0x01, 0x01, 0x02}; | 74 static guint8 features_aim[] = {0x01, 0x01, 0x01, 0x02}; |
75 static guint8 features_icq[] = {0x01}; | 75 static guint8 features_icq[] = {0x01}; |
76 static guint8 ck[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; | |
77 | 76 |
78 struct create_room { | 77 struct create_room { |
79 char *name; | 78 char *name; |
80 int exchange; | 79 int exchange; |
81 }; | 80 }; |
374 { | 373 { |
375 /* This only happens when connecting with the old-style BUCP login */ | 374 /* This only happens when connecting with the old-style BUCP login */ |
376 aim_request_login(od, conn, purple_account_get_username(account)); | 375 aim_request_login(od, conn, purple_account_get_username(account)); |
377 purple_debug_info("oscar", "Username sent, waiting for response\n"); | 376 purple_debug_info("oscar", "Username sent, waiting for response\n"); |
378 purple_connection_update_progress(gc, _("Username sent"), 1, OSCAR_CONNECT_STEPS); | 377 purple_connection_update_progress(gc, _("Username sent"), 1, OSCAR_CONNECT_STEPS); |
379 ck[1] = 0x65; | |
380 } | 378 } |
381 else if (conn->type == SNAC_FAMILY_LOCATE) | 379 else if (conn->type == SNAC_FAMILY_LOCATE) |
382 { | 380 { |
383 purple_connection_update_progress(gc, _("Connection established, cookie sent"), 4, OSCAR_CONNECT_STEPS); | 381 purple_connection_update_progress(gc, _("Connection established, cookie sent"), 4, OSCAR_CONNECT_STEPS); |
384 ck[4] = 0x61; | |
385 } | 382 } |
386 else if (conn->type == SNAC_FAMILY_CHAT) | 383 else if (conn->type == SNAC_FAMILY_CHAT) |
387 { | 384 { |
388 od->oscar_chats = g_slist_prepend(od->oscar_chats, conn->new_conn_data); | 385 od->oscar_chats = g_slist_prepend(od->oscar_chats, conn->new_conn_data); |
389 conn->new_conn_data = NULL; | 386 conn->new_conn_data = NULL; |
780 return; | 777 return; |
781 } | 778 } |
782 } | 779 } |
783 | 780 |
784 purple_connection_update_progress(gc, _("Connecting"), 0, OSCAR_CONNECT_STEPS); | 781 purple_connection_update_progress(gc, _("Connecting"), 0, OSCAR_CONNECT_STEPS); |
785 ck[0] = 0x5a; | |
786 } | 782 } |
787 | 783 |
788 void | 784 void |
789 oscar_close(PurpleConnection *gc) | 785 oscar_close(PurpleConnection *gc) |
790 { | 786 { |
1004 } | 1000 } |
1005 | 1001 |
1006 od->default_port = port; | 1002 od->default_port = port; |
1007 | 1003 |
1008 purple_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); | 1004 purple_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); |
1009 ck[3] = 0x64; | |
1010 | 1005 |
1011 return 1; | 1006 return 1; |
1012 } | 1007 } |
1013 | 1008 |
1014 /** | 1009 /** |
1124 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); | 1119 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); |
1125 return 0; | 1120 return 0; |
1126 } | 1121 } |
1127 | 1122 |
1128 purple_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); | 1123 purple_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); |
1129 ck[3] = 0x64; | |
1130 | 1124 |
1131 return 1; | 1125 return 1; |
1132 } | 1126 } |
1133 | 1127 |
1134 /** | 1128 /** |
1208 purple_connection_get_password(gc), truncate_pass, | 1202 purple_connection_get_password(gc), truncate_pass, |
1209 od->icq ? &icqinfo : &aiminfo, key, | 1203 od->icq ? &icqinfo : &aiminfo, key, |
1210 purple_account_get_bool(account, "allow_multiple_logins", OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS)); | 1204 purple_account_get_bool(account, "allow_multiple_logins", OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS)); |
1211 | 1205 |
1212 purple_connection_update_progress(gc, _("Password sent"), 2, OSCAR_CONNECT_STEPS); | 1206 purple_connection_update_progress(gc, _("Password sent"), 2, OSCAR_CONNECT_STEPS); |
1213 ck[2] = 0x6c; | |
1214 | 1207 |
1215 return 1; | 1208 return 1; |
1216 } | 1209 } |
1217 | 1210 |
1218 static int | 1211 static int |
1477 } | 1470 } |
1478 g_free(b16); | 1471 g_free(b16); |
1479 } | 1472 } |
1480 | 1473 |
1481 return 1; | 1474 return 1; |
1482 } | |
1483 | |
1484 static void purple_check_comment(OscarData *od, const char *str) { | |
1485 if ((str == NULL) || strcmp(str, (const char *)ck)) | |
1486 aim_locate_setcaps(od, purple_caps); | |
1487 else | |
1488 aim_locate_setcaps(od, purple_caps | OSCAR_CAPABILITY_SECUREIM); | |
1489 } | 1475 } |
1490 | 1476 |
1491 static int purple_parse_offgoing(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { | 1477 static int purple_parse_offgoing(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
1492 PurpleConnection *gc = od->gc; | 1478 PurpleConnection *gc = od->gc; |
1493 PurpleAccount *account = purple_connection_get_account(gc); | 1479 PurpleAccount *account = purple_connection_get_account(gc); |
3925 | 3911 |
3926 purple_debug_info("oscar", | 3912 purple_debug_info("oscar", |
3927 "ssi: adding buddy %s to group %s to local list\n", curitem->name, gname); | 3913 "ssi: adding buddy %s to group %s to local list\n", curitem->name, gname); |
3928 purple_blist_add_buddy(b, NULL, g, NULL); | 3914 purple_blist_add_buddy(b, NULL, g, NULL); |
3929 } | 3915 } |
3930 if (!oscar_util_name_compare(curitem->name, purple_account_get_username(account))) { | |
3931 char *comment = aim_ssi_getcomment(od->ssi.local, gname, curitem->name); | |
3932 if (comment != NULL) | |
3933 { | |
3934 purple_check_comment(od, comment); | |
3935 g_free(comment); | |
3936 } | |
3937 } | |
3938 | 3916 |
3939 /* Mobile users should always be online */ | 3917 /* Mobile users should always be online */ |
3940 if (curitem->name[0] == '+') { | 3918 if (curitem->name[0] == '+') { |
3941 purple_prpl_got_user_status(account, | 3919 purple_prpl_got_user_status(account, |
3942 purple_buddy_get_name(b), | 3920 purple_buddy_get_name(b), |
4801 PurpleConnection *gc; | 4779 PurpleConnection *gc; |
4802 PurpleAccount *account; | 4780 PurpleAccount *account; |
4803 OscarData *od; | 4781 OscarData *od; |
4804 PurpleBuddy *b; | 4782 PurpleBuddy *b; |
4805 PurpleGroup *g; | 4783 PurpleGroup *g; |
4806 const char *username; | |
4807 | 4784 |
4808 gc = data->gc; | 4785 gc = data->gc; |
4809 od = purple_connection_get_protocol_data(gc); | 4786 od = purple_connection_get_protocol_data(gc); |
4810 account = purple_connection_get_account(gc); | 4787 account = purple_connection_get_account(gc); |
4811 | 4788 |
4820 oscar_free_name_data(data); | 4797 oscar_free_name_data(data); |
4821 return; | 4798 return; |
4822 } | 4799 } |
4823 | 4800 |
4824 aim_ssi_editcomment(od, purple_group_get_name(g), data->name, text); | 4801 aim_ssi_editcomment(od, purple_group_get_name(g), data->name, text); |
4825 | |
4826 username = purple_account_get_username(account); | |
4827 if (!oscar_util_name_compare(data->name, username)) | |
4828 purple_check_comment(od, text); | |
4829 | |
4830 oscar_free_name_data(data); | 4802 oscar_free_name_data(data); |
4831 } | 4803 } |
4832 | 4804 |
4833 static void oscar_buddycb_edit_comment(PurpleBlistNode *node, gpointer ignore) { | 4805 static void oscar_buddycb_edit_comment(PurpleBlistNode *node, gpointer ignore) { |
4834 | 4806 |