Renamed stbbr_for -> stbbr_for_id

This commit is contained in:
James Booth
2015-06-01 22:02:18 +01:00
parent 66077b0194
commit ddb837cdcd
6 changed files with 10 additions and 10 deletions

View File

@@ -52,9 +52,9 @@ stbbr_auth_passwd(char *password)
} }
int int
stbbr_for(char *id, char *stream) stbbr_for_id(char *id, char *stream)
{ {
prime_for(id, stream); prime_for_id(id, stream);
return 1; return 1;
} }

View File

@@ -125,7 +125,7 @@ int connection_cb(void* cls, struct MHD_Connection* conn, const char* url, const
case STBBR_OP_FOR: case STBBR_OP_FOR:
id = MHD_lookup_connection_value(conn, MHD_GET_ARGUMENT_KIND, "id"); id = MHD_lookup_connection_value(conn, MHD_GET_ARGUMENT_KIND, "id");
if (id) { if (id) {
prime_for(id, con_info->body->str); prime_for_id(id, con_info->body->str);
return send_response(conn, NULL, MHD_HTTP_OK); return send_response(conn, NULL, MHD_HTTP_OK);
} else { } else {
return send_response(conn, NULL, MHD_HTTP_BAD_REQUEST); return send_response(conn, NULL, MHD_HTTP_BAD_REQUEST);

View File

@@ -61,7 +61,7 @@ prime_get_passwd(void)
} }
void void
prime_for(const char *id, char *stream) prime_for_id(const char *id, char *stream)
{ {
if (idstubs) { if (idstubs) {
g_hash_table_insert(idstubs, strdup(id), strdup(stream)); g_hash_table_insert(idstubs, strdup(id), strdup(stream));

View File

@@ -29,7 +29,7 @@ void prime_free_all(void);
void prime_required_passwd(char *password); void prime_required_passwd(char *password);
char* prime_get_passwd(void); char* prime_get_passwd(void);
int prime_for(const char *id, char *stream); int prime_for_id(const char *id, char *stream);
char* prime_get_for(const char *id); char* prime_get_for(const char *id);
#endif #endif

View File

@@ -29,7 +29,7 @@ void stbbr_stop(void);
void stbbr_set_timeout(int seconds); void stbbr_set_timeout(int seconds);
int stbbr_auth_passwd(char *password); int stbbr_auth_passwd(char *password);
void stbbr_for(char *id, char *stream); void stbbr_for_id(char *id, char *stream);
void stbbr_wait_for(char *id); void stbbr_wait_for(char *id);

View File

@@ -8,7 +8,7 @@ int main(void)
stbbr_auth_passwd("password"); stbbr_auth_passwd("password");
stbbr_for("roster", stbbr_for_id("roster",
"<iq id=\"roster\" type=\"result\" to=\"stabber@localhost/profanity\">" "<iq id=\"roster\" type=\"result\" to=\"stabber@localhost/profanity\">"
"<query xmlns=\"jabber:iq:roster\" ver=\"362\">" "<query xmlns=\"jabber:iq:roster\" ver=\"362\">"
"<item jid=\"buddy1@localhost\" subscription=\"both\" name=\"Buddy1\"/>" "<item jid=\"buddy1@localhost\" subscription=\"both\" name=\"Buddy1\"/>"
@@ -16,7 +16,7 @@ int main(void)
"</query>" "</query>"
"</iq>"); "</iq>");
stbbr_for("prof_presence_1", stbbr_for_id("prof_presence_1",
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">" "<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
"<show>dnd</show>" "<show>dnd</show>"
"<status>busy!</status>" "<status>busy!</status>"
@@ -30,12 +30,12 @@ int main(void)
"<status>Out of office</status>" "<status>Out of office</status>"
"</presence>"); "</presence>");
stbbr_for("prof_msg_2", stbbr_for_id("prof_msg_2",
"<message id=\"message1\" to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\" type=\"chat\">" "<message id=\"message1\" to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\" type=\"chat\">"
"<body>Welcome!!</body>" "<body>Welcome!!</body>"
"</message>"); "</message>");
stbbr_for("prof_msg_3", stbbr_for_id("prof_msg_3",
"<message id=\"message2\" to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\" type=\"chat\">" "<message id=\"message2\" to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\" type=\"chat\">"
"<body>From me laptop</body>" "<body>From me laptop</body>"
"</message>"); "</message>");