Skip to content

fix: forgot an enum in the nodes request rename #2890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions toxcore/events/dht_nodes_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static bool tox_event_dht_nodes_response_unpack_into(
const Tox_Event_Dht_Nodes_Response *tox_event_get_dht_nodes_response(
const Tox_Event *event)
{
return event->type == TOX_EVENT_DHT_GET_NODES_RESPONSE ? event->data.dht_nodes_response : nullptr;
return event->type == TOX_EVENT_DHT_NODES_RESPONSE ? event->data.dht_nodes_response : nullptr;
}

Tox_Event_Dht_Nodes_Response *tox_event_dht_nodes_response_new(const Memory *mem)
Expand Down Expand Up @@ -156,7 +156,7 @@ static Tox_Event_Dht_Nodes_Response *tox_events_add_dht_nodes_response(Tox_Event
}

Tox_Event event;
event.type = TOX_EVENT_DHT_GET_NODES_RESPONSE;
event.type = TOX_EVENT_DHT_NODES_RESPONSE;
event.data.dht_nodes_response = dht_nodes_response;

if (!tox_events_add(events, &event)) {
Expand Down
2 changes: 1 addition & 1 deletion toxcore/tox_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ static void tox_dispatch_invoke_event(const Tox_Dispatch *dispatch, const Tox_Ev
break;
}

case TOX_EVENT_DHT_GET_NODES_RESPONSE: {
case TOX_EVENT_DHT_NODES_RESPONSE: {
if (dispatch->dht_nodes_response_callback != nullptr) {
dispatch->dht_nodes_response_callback(event->data.dht_nodes_response, user_data);
}
Expand Down
16 changes: 8 additions & 8 deletions toxcore/tox_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ const char *tox_event_type_to_string(Tox_Event_Type type)
case TOX_EVENT_GROUP_MODERATION:
return "TOX_EVENT_GROUP_MODERATION";

case TOX_EVENT_DHT_GET_NODES_RESPONSE:
return "TOX_EVENT_DHT_GET_NODES_RESPONSE";
case TOX_EVENT_DHT_NODES_RESPONSE:
return "TOX_EVENT_DHT_NODES_RESPONSE";

case TOX_EVENT_INVALID:
return "TOX_EVENT_INVALID";
Expand Down Expand Up @@ -350,7 +350,7 @@ bool tox_event_construct(Tox_Event *event, Tox_Event_Type type, const Memory *me
break;
}

case TOX_EVENT_DHT_GET_NODES_RESPONSE: {
case TOX_EVENT_DHT_NODES_RESPONSE: {
event->data.dht_nodes_response = tox_event_dht_nodes_response_new(mem);
break;
}
Expand Down Expand Up @@ -565,7 +565,7 @@ void tox_event_destruct(Tox_Event *event, const Memory *mem)
break;
}

case TOX_EVENT_DHT_GET_NODES_RESPONSE: {
case TOX_EVENT_DHT_NODES_RESPONSE: {
tox_event_dht_nodes_response_free(event->data.dht_nodes_response, mem);
break;
}
Expand Down Expand Up @@ -705,7 +705,7 @@ static bool tox_event_data_pack(Tox_Event_Type type, const Tox_Event_Data *data,
case TOX_EVENT_GROUP_MODERATION:
return tox_event_group_moderation_pack(data->group_moderation, bp);

case TOX_EVENT_DHT_GET_NODES_RESPONSE:
case TOX_EVENT_DHT_NODES_RESPONSE:
return tox_event_dht_nodes_response_pack(data->dht_nodes_response, bp);

case TOX_EVENT_INVALID:
Expand Down Expand Up @@ -923,8 +923,8 @@ static bool tox_event_type_from_int(uint32_t value, Tox_Event_Type *out_enum)
return true;
}

case TOX_EVENT_DHT_GET_NODES_RESPONSE: {
*out_enum = TOX_EVENT_DHT_GET_NODES_RESPONSE;
case TOX_EVENT_DHT_NODES_RESPONSE: {
*out_enum = TOX_EVENT_DHT_NODES_RESPONSE;
return true;
}

Expand Down Expand Up @@ -1069,7 +1069,7 @@ static bool tox_event_data_unpack(Tox_Event_Type type, Tox_Event_Data *data, Bin
case TOX_EVENT_GROUP_MODERATION:
return tox_event_group_moderation_unpack(&data->group_moderation, bu, mem);

case TOX_EVENT_DHT_GET_NODES_RESPONSE:
case TOX_EVENT_DHT_NODES_RESPONSE:
return tox_event_dht_nodes_response_unpack(&data->dht_nodes_response, bu, mem);

case TOX_EVENT_INVALID:
Expand Down
2 changes: 1 addition & 1 deletion toxcore/tox_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ typedef enum Tox_Event_Type {
TOX_EVENT_GROUP_JOIN_FAIL = 37,
TOX_EVENT_GROUP_MODERATION = 38,

TOX_EVENT_DHT_GET_NODES_RESPONSE = 39,
TOX_EVENT_DHT_NODES_RESPONSE = 39,

TOX_EVENT_INVALID = 255,
} Tox_Event_Type;
Expand Down
Loading