diff options
author | Alfred E. Heggestad <aeh@db.org> | 2016-08-16 19:16:20 +0200 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2016-08-16 19:16:20 +0200 |
commit | ecf430548c909657eee0b63dcf0b77d68328a1a7 (patch) | |
tree | 0c94eb1405a0ae18ce9d69e81c9abe23bf54882f /modules/contact/contact.c | |
parent | 0dac038f7eb90533c0ffee8a673975d735b28a0e (diff) |
contact: check if chat_peer is set
Diffstat (limited to 'modules/contact/contact.c')
-rw-r--r-- | modules/contact/contact.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/contact/contact.c b/modules/contact/contact.c index 918d9a3..8b25652 100644 --- a/modules/contact/contact.c +++ b/modules/contact/contact.c @@ -115,11 +115,14 @@ static int cmd_message(struct re_printf *pf, void *arg) const struct cmd_arg *carg = arg; int err; - (void)pf; + if (!str_isset(chat_peer)) { + return re_hprintf(pf, "contact: chat peer is not set\n"); + } err = message_send(uag_current(), chat_peer, carg->prm); if (err) { - (void)re_hprintf(pf, "chat: ua_im_send() failed (%m)\n", err); + (void)re_hprintf(pf, "contact: message_send() failed (%m)\n", + err); } return err; |