Mercurial > ~mikael > mcabber > hg
diff mcabber/src/commands.c @ 164:faf534be8ff0
[/trunk] Changeset 176 by mikael
* Add roster_free()
* Empty roster when disconnecting from the server / going offline
* Don't display buddies status when we're offline
* Fix a bug when the roster is empty and we try to send a message (commands.c)
author | mikael |
---|---|
date | Mon, 02 May 2005 20:31:01 +0000 |
parents | 6531bcf030ae |
children | aa5b635520ef |
line wrap: on
line diff
--- a/mcabber/src/commands.c Mon May 02 14:18:55 2005 +0000 +++ b/mcabber/src/commands.c Mon May 02 20:31:01 2005 +0000 @@ -319,18 +319,22 @@ void do_say(char *arg) { - gpointer bud = BUDDATA(current_buddy); + gpointer bud; scr_set_chatmode(TRUE); - if (current_buddy) { - if (!(buddy_gettype(bud) & ROSTER_TYPE_USER)) { - scr_LogPrint("This is not a user"); - return; - } - buddy_setflags(bud, ROSTER_FLAG_LOCK, TRUE); - send_message(arg); - } else { + + if (!current_buddy) { scr_LogPrint("Who are you talking to??"); + return; } + + bud = BUDDATA(current_buddy); + if (!(buddy_gettype(bud) & ROSTER_TYPE_USER)) { + scr_LogPrint("This is not a user"); + return; + } + + buddy_setflags(bud, ROSTER_FLAG_LOCK, TRUE); + send_message(arg); }