handle error messages from server

This commit is contained in:
Dmitry Podgorny
2012-10-18 18:18:44 +03:00
parent 7156436805
commit bfc9e9a72e
5 changed files with 94 additions and 1 deletions

View File

@@ -114,6 +114,24 @@ prof_handle_incoming_message(char *from, char *message)
}
}
void
prof_handle_error_message(const char *from, const char *err_msg)
{
char *msg, *fmt;
if (err_msg != NULL) {
fmt = "Error received from server: %s";
msg = (char *)malloc(strlen(err_msg) + strlen(fmt) - 1);
if (msg == NULL)
goto loop_out;
sprintf(msg, fmt, err_msg);
cons_bad_show(msg);
free(msg);
}
loop_out:
win_show_error_msg(from, err_msg);
}
void
prof_handle_login_success(const char *jid)
{