summaryrefslogtreecommitdiffstats
path: root/friendfinder/sender.c
diff options
context:
space:
mode:
Diffstat (limited to 'friendfinder/sender.c')
-rw-r--r--friendfinder/sender.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/friendfinder/sender.c b/friendfinder/sender.c
index cef8aeb..3472430 100644
--- a/friendfinder/sender.c
+++ b/friendfinder/sender.c
@@ -14,34 +14,33 @@ int resend = 0;
char* nick;
int first_send = 0;
-int run_session = 0;
BF_KEY key;
-int init_connection(char* server_ip, char* user)
+int init_connection_sender(char* server_ip, char* user)
{
- printf("initialising connection...\n");
+ printf("SENDER: initialising connection...\n");
session = irc_create_session(&callbacks);
int con = irc_connect(session, server_ip, 6667, NULL, user, user, user);
if (irc_is_connected(session) == 1)
{
- printf("connected... \n");
+ printf("SENDER: connected... \n");
return 0;
}
if (con != 0)
{
- printf("connection error-code: %i \n", con);
+ printf("SENDER: connection error-code: %i \n", con);
return 1;
}
}
-void disconnect()
+void disconnect_sender()
{
- printf("disconnected...\n");
+ printf("SENDER: disconnected...\n");
irc_disconnect(session);
irc_destroy_session(session);
}
@@ -98,17 +97,17 @@ void send_position(irc_session_t * session, const char * event, const char * ori
if (_x == 0 && _y == 0)
{
- printf("send succesfull %i %i \n", lat, lon);
+ printf("SENDER: send succesfull %i %i \n", lat, lon);
}
if (_y != 0)
{
- printf("error code due sending: %i \n", _y);
+ printf("SENDER: error code due sending: %i \n", _y);
}
if (_x != 0)
{
- printf("error code due sending: %i \n", _x);
+ printf("SENDER: error code due sending: %i \n", _x);
}
first_send = 1;
@@ -150,16 +149,12 @@ void sender_main(char *nick)
callbacks.event_channel = get_aknowledge;
- init_connection("127.0.0.1", nick);
+ init_connection_sender("127.0.0.1", nick);
}
void sender_run_irc()
{
- if (run_session == 0)
- {
- irc_run(session);
- run_session = 1;
- }
+ irc_run(session);
}
void sender_stop_irc()