Mercurial > pidgin.yaz
comparison src/protocols/oscar/oscar.c @ 6622:a4622f1fb5a1
[gaim-migrate @ 7146]
(10:10:23) Robot101: kills off OPT_CONN_* in favour of an enum, and deprecates all
the IM_FLAGS_* except IM_FLAG_AWAY which is made into GAIM_IM_AUTO_RESP in a
GaimImFlags enum.
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Mon, 25 Aug 2003 14:12:28 +0000 |
parents | 42fdf16f1dad |
children | 156e6643f9db |
comparison
equal
deleted
inserted
replaced
6621:42fdf16f1dad | 6622:a4622f1fb5a1 |
---|---|
654 gaim_debug(GAIM_DEBUG_MISC, "oscar", "oscar_login: gc = %p\n", gc); | 654 gaim_debug(GAIM_DEBUG_MISC, "oscar", "oscar_login: gc = %p\n", gc); |
655 | 655 |
656 if (isdigit(*(gaim_account_get_username(account)))) { | 656 if (isdigit(*(gaim_account_get_username(account)))) { |
657 od->icq = TRUE; | 657 od->icq = TRUE; |
658 } else { | 658 } else { |
659 gc->flags |= OPT_CONN_HTML; | 659 gc->flags |= GAIM_CONNECTION_HTML; |
660 gc->flags |= OPT_CONN_AUTO_RESP; | 660 gc->flags |= GAIM_CONNECTION_AUTO_RESP; |
661 } | 661 } |
662 od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, oscar_free_buddyinfo); | 662 od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, oscar_free_buddyinfo); |
663 | 663 |
664 sess = g_new0(aim_session_t, 1); | 664 sess = g_new0(aim_session_t, 1); |
665 | 665 |
2161 | 2161 |
2162 static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) { | 2162 static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) { |
2163 GaimConnection *gc = sess->aux_data; | 2163 GaimConnection *gc = sess->aux_data; |
2164 struct oscar_data *od = gc->proto_data; | 2164 struct oscar_data *od = gc->proto_data; |
2165 char *tmp; | 2165 char *tmp; |
2166 int flags = 0; | 2166 GaimImFlags flags = 0; |
2167 gsize convlen; | 2167 gsize convlen; |
2168 GError *err = NULL; | 2168 GError *err = NULL; |
2169 struct buddyinfo *bi; | 2169 struct buddyinfo *bi; |
2170 const char *iconfile; | 2170 const char *iconfile; |
2171 | 2171 |
2174 bi = g_new0(struct buddyinfo, 1); | 2174 bi = g_new0(struct buddyinfo, 1); |
2175 g_hash_table_insert(od->buddyinfo, g_strdup(normalize(userinfo->sn)), bi); | 2175 g_hash_table_insert(od->buddyinfo, g_strdup(normalize(userinfo->sn)), bi); |
2176 } | 2176 } |
2177 | 2177 |
2178 if (args->icbmflags & AIM_IMFLAGS_AWAY) | 2178 if (args->icbmflags & AIM_IMFLAGS_AWAY) |
2179 flags |= IM_FLAG_AWAY; | 2179 flags |= GAIM_IM_AUTO_RESP; |
2180 | 2180 |
2181 if (args->icbmflags & AIM_IMFLAGS_TYPINGNOT) | 2181 if (args->icbmflags & AIM_IMFLAGS_TYPINGNOT) |
2182 bi->typingnot = TRUE; | 2182 bi->typingnot = TRUE; |
2183 else | 2183 else |
2184 bi->typingnot = FALSE; | 2184 bi->typingnot = FALSE; |
4257 } | 4257 } |
4258 return 0; | 4258 return 0; |
4259 } | 4259 } |
4260 static void oscar_ask_direct_im(GaimConnection *gc, const char *name); | 4260 static void oscar_ask_direct_im(GaimConnection *gc, const char *name); |
4261 | 4261 |
4262 static int oscar_send_im(GaimConnection *gc, const char *name, const char *message, int len, int imflags) { | 4262 static int oscar_send_im(GaimConnection *gc, const char *name, const char *message, int len, GaimImFlags imflags) { |
4263 struct oscar_data *od = (struct oscar_data *)gc->proto_data; | 4263 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
4264 struct direct_im *dim = find_direct_im(od, name); | 4264 struct direct_im *dim = find_direct_im(od, name); |
4265 int ret = 0; | 4265 int ret = 0; |
4266 GError *err = NULL; | 4266 GError *err = NULL; |
4267 const char *iconfile = gaim_account_get_buddy_icon(gaim_connection_get_account(gc)); | 4267 const char *iconfile = gaim_account_get_buddy_icon(gaim_connection_get_account(gc)); |
4268 char *tmpmsg = NULL; | 4268 char *tmpmsg = NULL; |
4269 | 4269 |
4270 if (dim && dim->connected) { | 4270 if (dim && dim->connected) { |
4271 /* If we're directly connected, send a direct IM */ | 4271 /* If we're directly connected, send a direct IM */ |
4272 /* XXX - The last parameter below is the encoding. Let Paco-Paco do something with it. */ | 4272 /* XXX - The last parameter below is the encoding. Let Paco-Paco do something with it. */ |
4273 if (imflags & IM_FLAG_AWAY) | 4273 if (imflags & GAIM_IM_AUTO_RESP) |
4274 ret = aim_odc_send_im(od->sess, dim->conn, message, len == -1 ? strlen(message) : len, 0, 1); | 4274 ret = aim_odc_send_im(od->sess, dim->conn, message, len == -1 ? strlen(message) : len, 0, 1); |
4275 else | 4275 else |
4276 ret = aim_odc_send_im(od->sess, dim->conn, message, len == -1 ? strlen(message) : len, 0, 0); | 4276 ret = aim_odc_send_im(od->sess, dim->conn, message, len == -1 ? strlen(message) : len, 0, 0); |
4277 } else if (len != -1) { | 4277 } else if (len != -1) { |
4278 /* Trying to send an IM image outside of a direct connection. */ | 4278 /* Trying to send an IM image outside of a direct connection. */ |
4297 args.flags |= AIM_IMFLAGS_OFFLINE; | 4297 args.flags |= AIM_IMFLAGS_OFFLINE; |
4298 } else { | 4298 } else { |
4299 args.features = features_aim; | 4299 args.features = features_aim; |
4300 args.featureslen = sizeof(features_aim); | 4300 args.featureslen = sizeof(features_aim); |
4301 | 4301 |
4302 if (imflags & IM_FLAG_AWAY) | 4302 if (imflags & GAIM_IM_AUTO_RESP) |
4303 args.flags |= AIM_IMFLAGS_AWAY; | 4303 args.flags |= AIM_IMFLAGS_AWAY; |
4304 } | 4304 } |
4305 | 4305 |
4306 if (bi->ico_need) { | 4306 if (bi->ico_need) { |
4307 gaim_debug(GAIM_DEBUG_INFO, "oscar", | 4307 gaim_debug(GAIM_DEBUG_INFO, "oscar", |
5631 return 1; | 5631 return 1; |
5632 } | 5632 } |
5633 | 5633 |
5634 static int gaim_odc_incoming(aim_session_t *sess, aim_frame_t *fr, ...) { | 5634 static int gaim_odc_incoming(aim_session_t *sess, aim_frame_t *fr, ...) { |
5635 GaimConnection *gc = sess->aux_data; | 5635 GaimConnection *gc = sess->aux_data; |
5636 int imflags = 0; | 5636 GaimImFlags imflags = 0; |
5637 va_list ap; | 5637 va_list ap; |
5638 char *sn, *msg; | 5638 char *sn, *msg; |
5639 int len, encoding, isawaymsg; | 5639 int len, encoding, isawaymsg; |
5640 | 5640 |
5641 va_start(ap, fr); | 5641 va_start(ap, fr); |
5648 | 5648 |
5649 gaim_debug(GAIM_DEBUG_INFO, "oscar", | 5649 gaim_debug(GAIM_DEBUG_INFO, "oscar", |
5650 "Got DirectIM message from %s\n", sn); | 5650 "Got DirectIM message from %s\n", sn); |
5651 | 5651 |
5652 if (isawaymsg) | 5652 if (isawaymsg) |
5653 imflags |= IM_FLAG_AWAY; | 5653 imflags |= GAIM_IM_AUTO_RESP; |
5654 | 5654 |
5655 /* XXX - I imagine Paco-Paco will want to do some voodoo with the encoding here */ | 5655 /* XXX - I imagine Paco-Paco will want to do some voodoo with the encoding here */ |
5656 serv_got_im(gc, sn, msg, imflags, time(NULL), len); | 5656 serv_got_im(gc, sn, msg, imflags, time(NULL), len); |
5657 | 5657 |
5658 return 1; | 5658 return 1; |