Mercurial > pidgin
comparison src/server.c @ 511:3133ab511d92
[gaim-migrate @ 521]
beginnings of directim, some improvements to oscar chat stuff
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Thu, 20 Jul 2000 18:34:25 +0000 |
| parents | 6e318907bcce |
| children | eaddaa0dbbcb |
comparison
equal
deleted
inserted
replaced
| 510:dab0c611029e | 511:3133ab511d92 |
|---|---|
| 155 | 155 |
| 156 | 156 |
| 157 | 157 |
| 158 void serv_send_im(char *name, char *message, int away) | 158 void serv_send_im(char *name, char *message, int away) |
| 159 { | 159 { |
| 160 if (!USE_OSCAR) { | 160 struct conversation *cnv = find_conversation(name); |
| 161 char buf[MSG_LEN - 7]; | 161 if (!cnv || !cnv->is_direct) { |
| 162 | 162 if (!USE_OSCAR) { |
| 163 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name), | 163 char buf[MSG_LEN - 7]; |
| 164 message, ((away) ? " auto" : "")); | 164 |
| 165 sflap_send(buf, strlen(buf), TYPE_DATA); | 165 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name), |
| 166 } else { | 166 message, ((away) ? " auto" : "")); |
| 167 if (away) | 167 sflap_send(buf, strlen(buf), TYPE_DATA); |
| 168 aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, message); | 168 } else { |
| 169 else | 169 if (away) |
| 170 aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_ACK, message); | 170 aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, message); |
| 171 else | |
| 172 aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_ACK, message); | |
| 173 } | |
| 174 } else { | |
| 175 if (!USE_OSCAR) { | |
| 176 /* FIXME */ | |
| 177 } else { | |
| 178 sprintf(debug_buff, "Sending DirectIM to %s\n", name); | |
| 179 debug_print(debug_buff); | |
| 180 aim_send_im_direct(gaim_sess, cnv->conn, message); | |
| 181 } | |
| 171 } | 182 } |
| 172 if (!away) | 183 if (!away) |
| 173 serv_touch_idle(); | 184 serv_touch_idle(); |
| 174 } | 185 } |
| 175 | 186 |
| 176 void serv_get_info(char *name) | 187 void serv_get_info(char *name) |
| 177 { | 188 { |
| 178 if (!USE_OSCAR) { | 189 if (!USE_OSCAR) { |
| 179 char buf[MSG_LEN]; | 190 char buf[MSG_LEN]; |
| 180 g_snprintf(buf, MSG_LEN, "toc_get_info %s", normalize(name)); | 191 g_snprintf(buf, MSG_LEN, "toc_get_info %s", normalize(name)); |
| 181 sflap_send(buf, -1, TYPE_DATA); | 192 sflap_send(buf, -1, TYPE_DATA); |
| 182 } else { | 193 } else { |
| 183 aim_getinfo(gaim_sess, gaim_conn, name, AIM_GETINFO_GENERALINFO); | 194 aim_getinfo(gaim_sess, gaim_conn, name, AIM_GETINFO_GENERALINFO); |
| 184 } | 195 } |
| 185 } | 196 } |
| 186 | 197 |
| 187 void serv_get_away_msg(char *name) | 198 void serv_get_away_msg(char *name) |
| 188 { | 199 { |
| 189 if (!USE_OSCAR) { | 200 if (!USE_OSCAR) { |
| 190 /* HAHA! TOC doesn't have this yet */ | 201 /* HAHA! TOC doesn't have this yet */ |
| 191 } else { | 202 } else { |
| 192 aim_getinfo(gaim_sess, gaim_conn, name, AIM_GETINFO_AWAYMESSAGE); | 203 aim_getinfo(gaim_sess, gaim_conn, name, AIM_GETINFO_AWAYMESSAGE); |
| 193 } | 204 } |
| 194 } | 205 } |
| 195 | 206 |
| 196 void serv_get_dir(char *name) | 207 void serv_get_dir(char *name) |
| 197 { | 208 { |
| 1088 char buf[MSG_LEN]; | 1099 char buf[MSG_LEN]; |
| 1089 g_snprintf(buf, MSG_LEN, "toc_rvous_cancel %s %s %s", normalize(name), | 1100 g_snprintf(buf, MSG_LEN, "toc_rvous_cancel %s %s %s", normalize(name), |
| 1090 cookie, uid); | 1101 cookie, uid); |
| 1091 sflap_send(buf, strlen(buf), TYPE_DATA); | 1102 sflap_send(buf, strlen(buf), TYPE_DATA); |
| 1092 } | 1103 } |
| 1104 | |
| 1105 void serv_do_imimage(GtkWidget *w, char *name) { | |
| 1106 if (!USE_OSCAR) { | |
| 1107 } else { | |
| 1108 oscar_do_directim(name); | |
| 1109 } | |
| 1110 } | |
| 1111 | |
| 1112 void serv_got_imimage(char *name, char *cookie, char *ip, struct aim_conn_t *conn) | |
| 1113 { | |
| 1114 if (!USE_OSCAR) { | |
| 1115 /* FIXME */ | |
| 1116 } else { | |
| 1117 struct conversation *cnv = find_conversation(name); | |
| 1118 if (!cnv) cnv = new_conversation(name); | |
| 1119 cnv->is_direct = 1; | |
| 1120 cnv->conn = conn; | |
| 1121 } | |
| 1122 } |
