[ekg2-commit] r4135 - in trunk/plugins: feed jabber polchat sniff: trunk/plugins/feed/nntp.c trunk/plugins/feed/rss.c trunk/plugins/jabber/jabber_handlers_tlen.c trunk/plugins/polchat/polchat.c trunk/plugins/polchat/polchat_handlers.c trunk/plugins/sniff/sniff.c
SVN commit
svn w toxygen.net
Sob, 19 Lip 2008, 13:53:22 CEST
Author: darkjames
Date: 2008-07-19 13:53:22 +0200 (Sat, 19 Jul 2008)
New Revision: 4135
Modified:
trunk/plugins/feed/nntp.c
trunk/plugins/feed/rss.c
trunk/plugins/jabber/jabber_handlers_tlen.c
trunk/plugins/polchat/polchat.c
trunk/plugins/polchat/polchat_handlers.c
trunk/plugins/sniff/sniff.c
Log:
last part.
Modified: trunk/plugins/feed/nntp.c
===================================================================
--- trunk/plugins/feed/nntp.c 2008-07-19 11:45:44 UTC (rev 4134)
+++ trunk/plugins/feed/nntp.c 2008-07-19 11:53:22 UTC (rev 4135)
@@ -159,7 +159,7 @@
close(j->fd);
j->fd = -1;
- query_emit_id_ro(NULL, PROTOCOL_DISCONNECTED, &s->uid, &reason, &type, NULL);
+ protocol_disconnected_emit(s, reason, type);
}
typedef struct {
@@ -611,7 +611,7 @@
}
j->connecting = 0;
- query_emit_id(NULL, PROTOCOL_CONNECTED, &data);
+ protocol_connected_emit(s);
watch_add_line(&feed_plugin, fd, WATCH_READ_LINE, nntp_handle_stream, xstrdup(data));
j->send_watch = watch_add_line(&feed_plugin, fd, WATCH_WRITE_LINE, NULL, NULL);
Modified: trunk/plugins/feed/rss.c
===================================================================
--- trunk/plugins/feed/rss.c 2008-07-19 11:45:44 UTC (rev 4134)
+++ trunk/plugins/feed/rss.c 2008-07-19 11:53:22 UTC (rev 4135)
@@ -40,6 +40,7 @@
#include <ekg/dynstuff.h>
#include <ekg/commands.h>
#include <ekg/debug.h>
+#include <ekg/protocol.h>
#include <ekg/sessions.h>
#include <ekg/userlist.h>
#include <ekg/stuff.h>
@@ -976,8 +977,8 @@
}
session_connected_set(session, 1);
- query_emit_id_ro(NULL, PROTOCOL_CONNECTED, &session->uid);
session->status = EKG_STATUS_AVAIL;
+ protocol_connected_emit(session);
return 0;
}
Modified: trunk/plugins/jabber/jabber_handlers_tlen.c
===================================================================
--- trunk/plugins/jabber/jabber_handlers_tlen.c 2008-07-19 11:45:44 UTC (rev 4134)
+++ trunk/plugins/jabber/jabber_handlers_tlen.c 2008-07-19 11:53:22 UTC (rev 4135)
@@ -91,23 +91,8 @@
text = tlen_decode(body->str);
string_free(body, 1);
- {
- char *me = xstrdup(session_uid_get(s));
- char *uid = xstrdup("ludzie.tlen.pl");
- char **rcpts = NULL;
- uint32_t *format= NULL;
- time_t sent = time(NULL);
- int class = EKG_MSGCLASS_MESSAGE;
- char *seq = NULL;
- int ekgbeep = EKG_TRY_BEEP;
- int secure = 0;
+ protocol_message_emit(s, "ludzie.tlen.pl", NULL, text, NULL, time(NULL), EKG_MSGCLASS_MESSAGE, NULL, EKG_TRY_BEEP, 0);
- query_emit_id(NULL, PROTOCOL_MESSAGE, &me, &uid, &rcpts, &text, &format, &sent, &class, &seq, &ekgbeep, &secure);
-
- xfree(me);
- xfree(uid);
- }
-
xfree(text);
}
Modified: trunk/plugins/polchat/polchat.c
===================================================================
--- trunk/plugins/polchat/polchat.c 2008-07-19 11:45:44 UTC (rev 4134)
+++ trunk/plugins/polchat/polchat.c 2008-07-19 11:53:22 UTC (rev 4135)
@@ -303,16 +303,9 @@
j->connecting = 0;
userlist_free(s);
- {
- char *__session = xstrdup(session_uid_get(s));
- char *__reason = xstrdup(reason);
- query_emit_id(NULL, PROTOCOL_DISCONNECTED, &__session, &__reason, &type);
+ protocol_disconnected_emit(s, reason, type);
- xfree(__session);
- xfree(__reason);
- }
-
if (j->fd != -1) {
list_t l;
Modified: trunk/plugins/polchat/polchat_handlers.c
===================================================================
--- trunk/plugins/polchat/polchat_handlers.c 2008-07-19 11:45:44 UTC (rev 4134)
+++ trunk/plugins/polchat/polchat_handlers.c 2008-07-19 11:53:22 UTC (rev 4135)
@@ -335,13 +335,7 @@
s->status = EKG_STATUS_AVAIL;
/* connected */
j->connecting = 0;
-
- {
- char *__session = xstrdup(s->uid);
- query_emit_id(NULL, PROTOCOL_CONNECTED, &__session);
- xfree(__session);
- }
-
+ protocol_connected_emit(s);
}
if (j->room) {
Modified: trunk/plugins/sniff/sniff.c
===================================================================
--- trunk/plugins/sniff/sniff.c 2008-07-19 11:45:44 UTC (rev 4134)
+++ trunk/plugins/sniff/sniff.c 2008-07-19 11:53:22 UTC (rev 4135)
@@ -2195,7 +2195,7 @@
session->status = EKG_STATUS_AVAIL;
- query_emit_id(NULL, PROTOCOL_CONNECTED, &(session->uid));
+ protocol_connected_emit(session);
return 0;
}
@@ -2205,14 +2205,8 @@
return -1;
}
- {
- char *uid = session->uid;
- char *reason = NULL;
- int type = EKG_DISCONNECT_USER;
+ protocol_disconnected_emit(session, NULL, EKG_DISCONNECT_USER);
- query_emit_id(NULL, PROTOCOL_DISCONNECTED, &uid, &reason, &type);
- }
-
if (!GET_DEV(session)) {
debug_error("sniff_command_disconnect() not dev?!\n");
return -1;
Więcej informacji o liście dyskusyjnej ekg2-commit