comparison mcabber/src/commands.c @ 81:0bd578421ce9

[/trunk] Changeset 95 by mikael * Switch from buddies.* to roster.* Seems to work fine...
author mikael
date Sat, 16 Apr 2005 22:28:55 +0000
parents 7259a61e1a4b
children 9a4aa2797f02
comparison
equal deleted inserted replaced
80:7fb661f19a77 81:0bd578421ce9
19 * USA 19 * USA
20 */ 20 */
21 21
22 #include "commands.h" 22 #include "commands.h"
23 #include "jabglue.h" 23 #include "jabglue.h"
24 #include "roster.h"
24 #include "screen.h" 25 #include "screen.h"
26 #include "utf8.h"
25 #include "utils.h" 27 #include "utils.h"
26 #include "buddies.h"
27 #include "utf8.h"
28 28
29 29
30 // send_message(msg) 30 // send_message(msg)
31 // Write the message in the buddy's window and send the message on 31 // Write the message in the buddy's window and send the message on
32 // the network. 32 // the network.
33 void send_message(char *msg) 33 void send_message(char *msg)
34 { 34 {
35 char *buffer; 35 char *buffer;
36 buddy_entry_t *tmp = bud_SelectedInfo(); 36 const char *jid;
37
38 if (!current_buddy) {
39 scr_LogPrint("No buddy currently selected.");
40 return;
41 }
42
43 jid = CURRENT_JID;
44 if (!jid) {
45 scr_LogPrint("No buddy currently selected.");
46 return;
47 }
37 48
38 // UI part 49 // UI part
39 scr_WriteOutgoingMessage(tmp->jid, msg); 50 scr_WriteOutgoingMessage(jid, msg);
40 51
41 // Network part 52 // Network part
42 buffer = utf8_encode(msg); 53 buffer = utf8_encode(msg);
43 jb_send_msg(tmp->jid, buffer); 54 jb_send_msg(jid, buffer);
44 free(buffer); 55 free(buffer);
45 } 56 }
46 57
47 // process_line(line) 58 // process_line(line)
48 // Process a command/message line. 59 // Process a command/message line.