Skip to content

Commit ed4c40e

Browse files
removed the deprecated events
1 parent c58e88c commit ed4c40e

File tree

5 files changed

+2
-141
lines changed

5 files changed

+2
-141
lines changed

include/livekit/room_delegate.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,6 @@ class RoomDelegate {
244244
*/
245245
virtual void onSipDtmfReceived(Room &, const SipDtmfReceivedEvent &) {}
246246

247-
/**
248-
* Called when a transcription result is received.
249-
*/
250-
virtual void onTranscriptionReceived(Room &,
251-
const TranscriptionReceivedEvent &) {}
252-
253-
/**
254-
* Called when a chat message is received.
255-
*/
256-
virtual void onChatMessageReceived(Room &, const ChatMessageReceivedEvent &) {
257-
}
258-
259247
// ------------------------------------------------------------------
260248
// Data streams
261249
// ------------------------------------------------------------------

include/livekit/room_event_types.h

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -105,29 +105,6 @@ enum class DisconnectReason {
105105
MediaFailure
106106
};
107107

108-
/**
109-
* A chat message associated with the room.
110-
*/
111-
struct ChatMessageData {
112-
/** Unique ID of the message. */
113-
std::string id;
114-
115-
/** Timestamp (ms since Unix epoch). */
116-
std::int64_t timestamp = 0;
117-
118-
/** Message body. */
119-
std::string message;
120-
121-
/** Optional timestamp when the message was edited (ms since Unix epoch). */
122-
std::optional<std::int64_t> edit_timestamp;
123-
124-
/** True if the message has been deleted. */
125-
bool deleted = false;
126-
127-
/** True if the message was generated (e.g. by an AI or system). */
128-
bool generated = false;
129-
};
130-
131108
/**
132109
* Application-level user data carried in a data packet.
133110
*/
@@ -647,21 +624,6 @@ struct Transcription {
647624
std::vector<TranscriptionSegment> segments;
648625
};
649626

650-
/**
651-
* Fired when a transcription result is received.
652-
*/
653-
struct TranscriptionReceivedEvent {
654-
/** Transcription segments for this update. */
655-
std::vector<TranscriptionSegment> segments;
656-
657-
/** Local or remote participant associated with these segments (owned by
658-
* Room). */
659-
Participant *participant = nullptr;
660-
661-
/** Publication of the track used for transcription, if available. */
662-
std::shared_ptr<TrackPublication> publication;
663-
};
664-
665627
/**
666628
* Fired when the room's connection state changes.
667629
*/
@@ -794,15 +756,4 @@ struct E2eeStateChangedEvent {
794756
EncryptionState state = EncryptionState::New;
795757
};
796758

797-
/**
798-
* Fired when a chat message is received.
799-
*/
800-
struct ChatMessageReceivedEvent {
801-
/** Chat message payload. */
802-
ChatMessageData message;
803-
804-
/** Identity of the participant who sent the message. */
805-
std::string participant_identity;
806-
};
807-
808759
} // namespace livekit

src/room.cpp

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -773,39 +773,7 @@ void Room::OnEvent(const FfiEvent &event) {
773773
// ------------------------------------------------------------------------
774774

775775
case proto::RoomEvent::kTranscriptionReceived: {
776-
TranscriptionReceivedEvent ev;
777-
{
778-
std::lock_guard<std::mutex> guard(lock_);
779-
const auto &tr = re.transcription_received();
780-
for (const auto &s : tr.segments()) {
781-
TranscriptionSegment seg;
782-
seg.id = s.id();
783-
seg.text = s.text();
784-
seg.final = s.final();
785-
seg.start_time = s.start_time();
786-
seg.end_time = s.end_time();
787-
seg.language = s.language();
788-
ev.segments.push_back(std::move(seg));
789-
}
790-
791-
Participant *participant = nullptr;
792-
if (!tr.participant_identity().empty()) {
793-
const std::string &identity = tr.participant_identity();
794-
if (local_participant_ &&
795-
local_participant_->identity() == identity) {
796-
participant = local_participant_.get();
797-
} else {
798-
auto it = remote_participants_.find(identity);
799-
if (it != remote_participants_.end()) {
800-
participant = it->second.get();
801-
}
802-
}
803-
}
804-
ev.participant = participant;
805-
ev.publication = participant->findTrackPublication(tr.track_sid());
806-
}
807-
808-
delegate_snapshot->onTranscriptionReceived(*this, ev);
776+
// Deprecated event, do nothing.
809777
break;
810778
}
811779

@@ -901,8 +869,7 @@ void Room::OnEvent(const FfiEvent &event) {
901869
break;
902870
}
903871
case proto::RoomEvent::kChatMessage: {
904-
auto ev = fromProto(re.chat_message());
905-
delegate_snapshot->onChatMessageReceived(*this, ev);
872+
// Deprecated event, do nothing.
906873
break;
907874
}
908875
case proto::RoomEvent::kStreamHeaderReceived: {

src/room_proto_converter.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,6 @@ DisconnectReason toDisconnectReason(proto::DisconnectReason /*in*/) {
6969

7070
// --------- basic helper conversions ---------
7171

72-
ChatMessageData fromProto(const proto::ChatMessage &in) {
73-
ChatMessageData out;
74-
out.id = in.id();
75-
out.timestamp = in.timestamp();
76-
out.message = in.message();
77-
if (in.has_edit_timestamp()) {
78-
out.edit_timestamp = in.edit_timestamp();
79-
}
80-
if (in.has_deleted()) {
81-
out.deleted = in.deleted();
82-
}
83-
if (in.has_generated()) {
84-
out.generated = in.generated();
85-
}
86-
return out;
87-
}
88-
8972
UserPacketData fromProto(const proto::UserPacket &in) {
9073
UserPacketData out;
9174
// TODO, double check following code is safe
@@ -299,13 +282,6 @@ RoomMovedEvent roomMovedFromProto(const proto::RoomInfo &in) {
299282
return ev;
300283
}
301284

302-
ChatMessageReceivedEvent fromProto(const proto::ChatMessageReceived &in) {
303-
ChatMessageReceivedEvent ev;
304-
ev.message = fromProto(in.message());
305-
ev.participant_identity = in.participant_identity();
306-
return ev;
307-
}
308-
309285
// ---------------- Room Options ----------------
310286

311287
proto::AudioEncoding toProto(const AudioEncodingOptions &in) {
@@ -420,21 +396,6 @@ TranscriptionSegment fromProto(const proto::TranscriptionSegment &in) {
420396
return out;
421397
}
422398

423-
Transcription fromProto(const proto::TranscriptionReceived &in) {
424-
Transcription out;
425-
if (in.has_participant_identity()) {
426-
out.participant_identity = in.participant_identity();
427-
}
428-
if (in.has_track_sid()) {
429-
out.track_sid = in.track_sid();
430-
}
431-
out.segments.reserve(in.segments_size());
432-
for (const auto &pseg : in.segments()) {
433-
out.segments.push_back(fromProto(pseg));
434-
}
435-
return out;
436-
}
437-
438399
UserDataPacketEvent userDataPacketFromProto(const proto::DataPacketReceived &in,
439400
RemoteParticipant *participant) {
440401
UserDataPacketEvent ev;

src/room_proto_converter.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ ConnectionState toConnectionState(proto::ConnectionState in);
3333
DataPacketKind toDataPacketKind(proto::DataPacketKind in);
3434
DisconnectReason toDisconnectReason(proto::DisconnectReason in);
3535

36-
ChatMessageData fromProto(const proto::ChatMessage &in);
3736
UserPacketData fromProto(const proto::UserPacket &in);
3837
SipDtmfData fromProto(const proto::SipDTMF &in);
3938
RoomInfoData fromProto(const proto::RoomInfo &in);
@@ -69,8 +68,6 @@ RoomUpdatedEvent
6968
roomUpdatedFromProto(const proto::RoomInfo &in); // room_updated
7069
RoomMovedEvent roomMovedFromProto(const proto::RoomInfo &in); // moved
7170

72-
ChatMessageReceivedEvent fromProto(const proto::ChatMessageReceived &in);
73-
7471
// --------- room options conversions ---------
7572

7673
proto::AudioEncoding toProto(const AudioEncodingOptions &in);
@@ -87,9 +84,6 @@ TrackPublishOptions fromProto(const proto::TrackPublishOptions &in);
8784
proto::TranscriptionSegment toProto(const TranscriptionSegment &in);
8885
TranscriptionSegment fromProto(const proto::TranscriptionSegment &in);
8986

90-
proto::TranscriptionReceived toProto(const TranscriptionReceivedEvent &in);
91-
Transcription fromProto(const proto::TranscriptionReceived &in);
92-
9387
// --------- room Data Packet conversions ---------
9488

9589
UserDataPacketEvent userDataPacketFromProto(const proto::DataPacketReceived &in,

0 commit comments

Comments
 (0)