| 160 } |
160 } |
| 161 write(idata->fd, "\n", 1); |
161 write(idata->fd, "\n", 1); |
| 162 } |
162 } |
| 163 |
163 |
| 164 |
164 |
| 165 static void irc_send_im(struct gaim_connection *gc, char *who, char *message, int away) |
165 static int irc_send_im(struct gaim_connection *gc, char *who, char *message, int away) |
| 166 { |
166 { |
| 167 |
167 |
| 168 struct irc_data *idata = (struct irc_data *)gc->proto_data; |
168 struct irc_data *idata = (struct irc_data *)gc->proto_data; |
| 169 gchar *buf = (gchar *) g_malloc(IRC_BUF_LEN + 1); |
169 gchar *buf = (gchar *) g_malloc(IRC_BUF_LEN + 1); |
| 170 |
170 |
| 193 gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); |
193 gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); |
| 194 strcpy(temp, message + 7); |
194 strcpy(temp, message + 7); |
| 195 irc_get_info(gc, temp); |
195 irc_get_info(gc, temp); |
| 196 g_free(temp); |
196 g_free(temp); |
| 197 |
197 |
| 198 return; |
198 return 0; |
| 199 } |
199 } |
| 200 |
200 |
| 201 } else { |
201 } else { |
| 202 g_snprintf(buf, IRC_BUF_LEN, "PRIVMSG %s :%s\n", who, message); |
202 g_snprintf(buf, IRC_BUF_LEN, "PRIVMSG %s :%s\n", who, message); |
| 203 } |
203 } |
| 204 |
204 |
| 205 write(idata->fd, buf, strlen(buf)); |
205 write(idata->fd, buf, strlen(buf)); |
| 206 |
206 |
| 207 g_free(buf); |
207 g_free(buf); |
| |
208 return 0; |
| 208 } |
209 } |
| 209 |
210 |
| 210 static int find_id_by_name(struct gaim_connection *gc, char *name) |
211 static int find_id_by_name(struct gaim_connection *gc, char *name) |
| 211 { |
212 { |
| 212 gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); |
213 gchar *temp = (gchar *) g_malloc(IRC_BUF_LEN + 1); |