summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <devilhorns@comcast.net>2021-02-12 15:35:13 -0500
committerChristopher Michael <devilhorns@comcast.net>2021-02-12 15:35:13 -0500
commitb84c4fd9941cacdfc3322a47493b065e3588688a (patch)
tree9a9957060dfca0a184a0713efa48c2cca3e61cd5
parenta7c02223db34b747b24a782da26ffdcff1748a3d (diff)
express: If we cannot find a channel to display a message, just use
Status channel
-rw-r--r--src/bin/callbacks.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/bin/callbacks.c b/src/bin/callbacks.c
index adc5221..0211634 100644
--- a/src/bin/callbacks.c
+++ b/src/bin/callbacks.c
@@ -121,8 +121,7 @@ _callback_channel_notice(Express_Network *net EINA_UNUSED, const char *event EIN
121 if (!(chl = _window_channel_find("Status"))) 121 if (!(chl = _window_channel_find("Status")))
122 { 122 {
123 ERR("Could not find channel with server name: %s", source); 123 ERR("Could not find channel with server name: %s", source);
124 if (!(chl = _window_channel_find("Status"))) 124 chl = _window_channel_active_get();
125 chl = _window_channel_active_get();
126 } 125 }
127 } 126 }
128 else 127 else
@@ -339,26 +338,18 @@ _callback_user_private(Express_Network *net, const char *event EINA_UNUSED, cons
339{ 338{
340 Channel * chl = NULL; 339 Channel * chl = NULL;
341 340
342 DBG("User Private %s", params[0]); 341 /* DBG("User Private %s", params[0]); */
343 DBG("\tCount: %d", count); 342 /* DBG("\tCount: %d", count); */
344 DBG("\tUser: %s", source); 343 /* DBG("\tUser: %s", source); */
345 DBG("\tMessage:"); 344 /* DBG("\tMessage:"); */
346 DBG("\t%s", params[1]); // message 345 /* DBG("\t%s", params[1]); */
347 DBG("\t%s", params[2]); 346 /* DBG("\t%s", params[2]); */
348 DBG("\t%s", params[3]); 347 /* DBG("\t%s", params[3]); */
349 348
350 if (!(chl = _window_channel_find(source))) 349 if (!(chl = _window_channel_find(source)))
351 { 350 {
352 Express_Server *srv; 351 if (!(chl = _window_channel_find("Status")))
353 352 return;
354 if ((srv = express_network_server_connected_get(net)))
355 {
356 const char *srv_name = NULL;
357
358 srv_name = express_network_server_realname_get(srv);
359 chl = _window_channel_create(net, source, srv_name);
360 if (!chl) return;
361 }
362 } 353 }
363 354
364 _channel_text_append(chl, source, params[1], 355 _channel_text_append(chl, source, params[1],