Mercurial > pidgin
comparison src/protocols/oscar/oscar.c @ 11253:7d31d61e6438
[gaim-migrate @ 13422]
Get rid of faimdprintf and use gaim_debug functions instead
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 13 Aug 2005 06:43:45 +0000 |
parents | ad9a61894d9b |
children | bb0d7b719af2 |
comparison
equal
deleted
inserted
replaced
11252:55356a29cdd1 | 11253:7d31d61e6438 |
---|---|
66 #define OSCAR_DEFAULT_HIDE_IP TRUE | 66 #define OSCAR_DEFAULT_HIDE_IP TRUE |
67 #define OSCAR_DEFAULT_WEB_AWARE FALSE | 67 #define OSCAR_DEFAULT_WEB_AWARE FALSE |
68 | 68 |
69 /* Seconds each file transfer ip address will be given to make a connection */ | 69 /* Seconds each file transfer ip address will be given to make a connection */ |
70 #define FT_IP_TIMEOUT 15 | 70 #define FT_IP_TIMEOUT 15 |
71 | |
72 #define FAIM_DEBUG_LEVEL 0 | |
73 | 71 |
74 static int caps_aim = AIM_CAPS_CHAT | AIM_CAPS_BUDDYICON | AIM_CAPS_DIRECTIM | AIM_CAPS_SENDFILE | AIM_CAPS_INTEROPERATE | AIM_CAPS_ICHAT; | 72 static int caps_aim = AIM_CAPS_CHAT | AIM_CAPS_BUDDYICON | AIM_CAPS_DIRECTIM | AIM_CAPS_SENDFILE | AIM_CAPS_INTEROPERATE | AIM_CAPS_ICHAT; |
75 static int caps_icq = AIM_CAPS_BUDDYICON | AIM_CAPS_DIRECTIM | AIM_CAPS_SENDFILE | AIM_CAPS_ICQUTF8 | AIM_CAPS_INTEROPERATE | AIM_CAPS_ICHAT; | 73 static int caps_icq = AIM_CAPS_BUDDYICON | AIM_CAPS_DIRECTIM | AIM_CAPS_SENDFILE | AIM_CAPS_ICQUTF8 | AIM_CAPS_INTEROPERATE | AIM_CAPS_ICHAT; |
76 | 74 |
77 static fu8_t features_aim[] = {0x01, 0x01, 0x01, 0x02}; | 75 static fu8_t features_aim[] = {0x01, 0x01, 0x01, 0x02}; |
1711 } | 1709 } |
1712 } | 1710 } |
1713 } | 1711 } |
1714 } | 1712 } |
1715 | 1713 |
1716 static void oscar_debug(aim_session_t *sess, int level, const char *format, va_list va) { | |
1717 GaimConnection *gc = sess->aux_data; | |
1718 gchar *s = g_strdup_vprintf(format, va); | |
1719 gchar *buf; | |
1720 | |
1721 buf = g_strdup_printf("%s %d: %s", gaim_account_get_username(gaim_connection_get_account(gc)), level, s); | |
1722 gaim_debug_info("oscar", buf); | |
1723 if (buf[strlen(buf)-1] != '\n') | |
1724 gaim_debug_info(NULL, "\n"); | |
1725 g_free(buf); | |
1726 g_free(s); | |
1727 } | |
1728 | |
1729 static void oscar_login_connect(gpointer data, gint source, GaimInputCondition cond) | 1714 static void oscar_login_connect(gpointer data, gint source, GaimInputCondition cond) |
1730 { | 1715 { |
1731 GaimConnection *gc = data; | 1716 GaimConnection *gc = data; |
1732 OscarData *od; | 1717 OscarData *od; |
1733 aim_session_t *sess; | 1718 aim_session_t *sess; |
1790 gc->flags |= GAIM_CONNECTION_AUTO_RESP; | 1775 gc->flags |= GAIM_CONNECTION_AUTO_RESP; |
1791 } | 1776 } |
1792 od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, oscar_free_buddyinfo); | 1777 od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, oscar_free_buddyinfo); |
1793 | 1778 |
1794 sess = g_new0(aim_session_t, 1); | 1779 sess = g_new0(aim_session_t, 1); |
1795 aim_session_init(sess, TRUE, FAIM_DEBUG_LEVEL); | 1780 aim_session_init(sess, TRUE); |
1796 aim_setdebuggingcb(sess, oscar_debug); | |
1797 /* | 1781 /* |
1798 * We need an immediate queue because we don't use a while-loop | 1782 * We need an immediate queue because we don't use a while-loop |
1799 * to see if things need to be sent. | 1783 * to see if things need to be sent. |
1800 */ | 1784 */ |
1801 aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL); | 1785 aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL); |