Skip to content

Commit 12016c3

Browse files
bnjbvrpoljar
authored andcommitted
rust: fix build failure caused by change in notification item
1 parent 4b04f9c commit 12016c3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

internal/api/rust/rust.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,20 @@ func (c *RustClient) GetNotification(t ct.TestLike, roomID, eventID string) (*ap
160160
return nil, fmt.Errorf("GetNotification: failed to create NotificationClient: %s", err)
161161
}
162162
}
163-
notifItem, err := c.notifClient.GetNotification(roomID, eventID)
163+
notifStatus, err := c.notifClient.GetNotification(roomID, eventID)
164164
if err != nil {
165165
return nil, fmt.Errorf("GetNotification: %s", err)
166166
}
167+
167168
// TODO: handle NotificationEventInvite
169+
var notifItem *matrix_sdk_ffi.NotificationItem = nil
170+
switch notifItemType := notifStatus.(type) {
171+
case matrix_sdk_ffi.NotificationStatusEvent:
172+
notifItem = &notifItemType.Item
173+
}
174+
if notifItem == nil {
175+
log.Panicf("GetNotification: unexpected notification status type %T", notifItem)
176+
}
168177
notifEvent := notifItem.Event.(matrix_sdk_ffi.NotificationEventTimeline)
169178
// TODO: handle notifications other than messages..
170179
evType, err := notifEvent.Event.EventType()

0 commit comments

Comments
 (0)