mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 19:36:22 +00:00
handle error messages from server
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user