Mercurial > pidgin.yaz
comparison src/gtkconv.c @ 9175:3e2ea5b69605
[gaim-migrate @ 9970]
W and S are now implemented for /cmds in core.
This means you can do /me with colors again.
This was probably the hardest part of cmds that was left to do. So the rest
should be fairly easy. Hopefully there's no major bugs in this. There's
some inconsist use of g_utf8_isspace vs strchr(s, ' ') I want to clean up
yet that will cause some oddness if you use a tab instead of a space as
your argument separater.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Sat, 05 Jun 2004 07:33:58 +0000 |
parents | 10bdd25f367f |
children | b6e3dcb23de0 |
comparison
equal
deleted
inserted
replaced
9174:a839ef5d2f34 | 9175:3e2ea5b69605 |
---|---|
347 const char *cmd, char **args, char **error) | 347 const char *cmd, char **args, char **error) |
348 { | 348 { |
349 char *tmp; | 349 char *tmp; |
350 | 350 |
351 tmp = g_strdup_printf("/me %s", args[0]); | 351 tmp = g_strdup_printf("/me %s", args[0]); |
352 | 352 |
353 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) | 353 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) |
354 gaim_conv_im_send(GAIM_CONV_IM(conv), tmp); | 354 gaim_conv_im_send(GAIM_CONV_IM(conv), tmp); |
355 else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) | 355 else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) |
356 gaim_conv_chat_send(GAIM_CONV_CHAT(conv), tmp); | 356 gaim_conv_chat_send(GAIM_CONV_CHAT(conv), tmp); |
357 | 357 |
375 | 375 |
376 if(gaim_prefs_get_bool("/gaim/gtk/conversations/enable_commands")) { | 376 if(gaim_prefs_get_bool("/gaim/gtk/conversations/enable_commands")) { |
377 cmd = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry), NULL, NULL); | 377 cmd = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry), NULL, NULL); |
378 if(cmd && (strncmp(cmd, prefix, strlen(prefix)) == 0)) { | 378 if(cmd && (strncmp(cmd, prefix, strlen(prefix)) == 0)) { |
379 GaimCmdStatus status; | 379 GaimCmdStatus status; |
380 char *error, *cmdline; | 380 char *error, *cmdline, *markup; |
381 GtkTextIter start, end; | |
381 | 382 |
382 cmdline = cmd + strlen(prefix); | 383 cmdline = cmd + strlen(prefix); |
383 status = gaim_cmd_do_command(conv, cmdline, &error); | 384 gtk_text_buffer_get_start_iter(GTK_IMHTML(gtkconv->entry)->text_buffer, &start); |
385 gtk_text_iter_forward_chars(&start, g_utf8_strlen(prefix, -1)); | |
386 gtk_text_buffer_get_end_iter(GTK_IMHTML(gtkconv->entry)->text_buffer, &end); | |
387 markup = gtk_imhtml_get_markup_range(GTK_IMHTML(gtkconv->entry), &start, &end); | |
388 status = gaim_cmd_do_command(conv, cmdline, markup, &error); | |
384 g_free(cmd); | 389 g_free(cmd); |
390 g_free(markup); | |
385 | 391 |
386 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); | 392 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); |
387 default_formatize(conv); | 393 default_formatize(conv); |
388 | 394 |
389 switch(status) { | 395 switch(status) { |