Mercurial > hg
diff mcabber/src/screen.c @ 35:a8ceaa3005fd
[/trunk] Changeset 51 by mikael
Work on libjabber integration. This is a big patch...
* Remove socket.[ch] server.[ch]
We have now fully switched to libjabber.
* Roster is fetched, and buddies are added to the buddylist
* Can send/receive messages using libjabber
* Presence messages are handled. I have added statuses, as there only were
online / offline statuses.
* Use halfdelay to have a non-blocking getch().
And use a timeout in jb_main().
* Use utf8_{encode,decode}
author | mikael |
---|---|
date | Mon, 04 Apr 2005 19:13:58 +0000 |
parents | 4ea2df449381 |
children | 416fd026d76d |
line wrap: on
line diff
--- a/mcabber/src/screen.c Mon Apr 04 18:00:51 2005 +0000 +++ b/mcabber/src/screen.c Mon Apr 04 19:13:58 2005 +0000 @@ -12,7 +12,6 @@ #include "buddies.h" #include "parsecfg.h" #include "lang.h" -#include "server.h" #include "list.h" #define window_entry(n) list_entry(n, window_entry_t, list) @@ -456,7 +455,7 @@ initscr(); noecho(); raw(); - //cbreak(); + halfdelay(5); start_color(); use_default_colors(); @@ -466,7 +465,7 @@ inputLine[0] = 0; ptr_inputline = inputLine; - //setlocale(LC_CTYPE, ""); + setlocale(LC_CTYPE, ""); return; } @@ -500,7 +499,6 @@ logPanel = new_panel(logWnd); wbkgd(logWnd, COLOR_PAIR(COLOR_GENERAL)); //wattrset(logWnd, COLOR_PAIR(COLOR_GENERAL)); - scr_LogPrint("Start up."); scrollok(logWnd,TRUE); //idlok(logWnd,TRUE); // XXX Necessary? @@ -529,7 +527,7 @@ int n, i; char *buffer = (char *) malloc(5 + strlen(text)); - sprintf(buffer, "<== %s", text); + sprintf(buffer, "<== %s", utf8_decode(text)); submsgs = ut_SplitMessage(buffer, &n, maxX - scr_WindowHeight(rosterWnd) - 20); @@ -642,7 +640,7 @@ refresh(); sprintf(buffer2, "%s@%s/%s", cfg_read("username"), cfg_read("server"), cfg_read("resource")); - // FIXME srv_sendtext(sock, tmp->jid, msg, buffer2); + jb_send_msg(tmp->jid, utf8_encode(msg)); free(buffer); free(buffer2); @@ -652,7 +650,7 @@ int process_line(char *line) { if (*line != '/') { - // FIXME send_message(sock, line); + send_message(line); return 0; } if (!strcasecmp(line, "/quit")) { @@ -660,7 +658,7 @@ } // Commands handling // TODO - // say... + // say, send_raw... scr_LogPrint("Unrecognised command, sorry."); return 0;