| 117 SilcPurple sg = gc->proto_data; |
117 SilcPurple sg = gc->proto_data; |
| 118 silc_client_send_packet(sg->client, sg->conn, SILC_PACKET_HEARTBEAT, |
118 silc_client_send_packet(sg->client, sg->conn, SILC_PACKET_HEARTBEAT, |
| 119 NULL, 0); |
119 NULL, 0); |
| 120 } |
120 } |
| 121 |
121 |
| 122 static int |
122 static gboolean |
| 123 silcpurple_scheduler(gpointer *context) |
123 silcpurple_scheduler(gpointer *context) |
| 124 { |
124 { |
| 125 SilcPurple sg = (SilcPurple)context; |
125 SilcPurple sg = (SilcPurple)context; |
| 126 silc_client_run_one(sg->client); |
126 silc_client_run_one(sg->client); |
| 127 return 1; |
127 return TRUE; |
| 128 } |
128 } |
| 129 |
129 |
| 130 static void |
130 static void |
| 131 silcpurple_nickname_parse(const char *nickname, |
131 silcpurple_nickname_parse(const char *nickname, |
| 132 char **ret_nickname) |
132 char **ret_nickname) |
| 359 purple_connection_error(gc, _("Unable to create connection")); |
359 purple_connection_error(gc, _("Unable to create connection")); |
| 360 return; |
360 return; |
| 361 } |
361 } |
| 362 |
362 |
| 363 /* Schedule SILC using Glib's event loop */ |
363 /* Schedule SILC using Glib's event loop */ |
| 364 #ifndef _WIN32 |
364 sg->scheduler = purple_timeout_add(300, (GSourceFunc)silcpurple_scheduler, sg); |
| 365 sg->scheduler = g_timeout_add(5, (GSourceFunc)silcpurple_scheduler, sg); |
|
| 366 #else |
|
| 367 sg->scheduler = g_timeout_add(300, (GSourceFunc)silcpurple_scheduler, sg); |
|
| 368 #endif |
|
| 369 } |
365 } |
| 370 |
366 |
| 371 static int |
367 static int |
| 372 silcpurple_close_final(gpointer *context) |
368 silcpurple_close_final(gpointer *context) |
| 373 { |
369 { |
| 394 "QUIT", "Download this: " PURPLE_WEBSITE, NULL); |
390 "QUIT", "Download this: " PURPLE_WEBSITE, NULL); |
| 395 |
391 |
| 396 if (sg->conn) |
392 if (sg->conn) |
| 397 silc_client_close_connection(sg->client, sg->conn); |
393 silc_client_close_connection(sg->client, sg->conn); |
| 398 |
394 |
| 399 g_source_remove(sg->scheduler); |
395 purple_timeout_remove(sg->scheduler); |
| 400 g_timeout_add(1, (GSourceFunc)silcpurple_close_final, sg); |
396 purple_timeout_add(1, (GSourceFunc)silcpurple_close_final, sg); |
| 401 } |
397 } |
| 402 |
398 |
| 403 |
399 |
| 404 /****************************** Protocol Actions *****************************/ |
400 /****************************** Protocol Actions *****************************/ |
| 405 |
401 |