Skip to content

Commit

Permalink
Adapt FFI bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinesp committed Sep 25, 2024
1 parent 529b1da commit 7eb4790
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions internal/api/rust/rust.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,20 +909,17 @@ func timelineItemToEvent(item *matrix_sdk_ffi.TimelineItem) *api.Event {
return eventTimelineItemToEvent(*ev)

Check failure on line 909 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

cannot use *ev (variable of type *matrix_sdk_ffi.EventTimelineItem) as matrix_sdk_ffi.EventTimelineItem value in argument to eventTimelineItemToEvent

Check failure on line 909 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

cannot use *ev (variable of type *matrix_sdk_ffi.EventTimelineItem) as matrix_sdk_ffi.EventTimelineItem value in argument to eventTimelineItemToEvent

Check failure on line 909 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

cannot use *ev (variable of type *matrix_sdk_ffi.EventTimelineItem) as matrix_sdk_ffi.EventTimelineItem value in argument to eventTimelineItemToEvent

Check failure on line 909 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

cannot use *ev (variable of type *matrix_sdk_ffi.EventTimelineItem) as matrix_sdk_ffi.EventTimelineItem value in argument to eventTimelineItemToEvent
}

func eventTimelineItemToEvent(item *matrix_sdk_ffi.EventTimelineItem) *api.Event {
if item == nil {
return nil
}
func eventTimelineItemToEvent(item matrix_sdk_ffi.EventTimelineItem) *api.Event {
eventID := ""
if item.EventId() != nil {
eventID = *item.EventId()
if item.EventId != nil {

Check failure on line 914 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

item.EventId undefined (type matrix_sdk_ffi.EventTimelineItem has no field or method EventId)

Check failure on line 914 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

item.EventId undefined (type matrix_sdk_ffi.EventTimelineItem has no field or method EventId)
eventID = *item.EventId

Check failure on line 915 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

invalid operation: cannot indirect item.EventId (value of type func() *string)

Check failure on line 915 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

invalid operation: cannot indirect item.EventId (value of type func() *string)

Check failure on line 915 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

invalid operation: cannot indirect item.EventId (value of type func() *string)

Check failure on line 915 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

invalid operation: cannot indirect item.EventId (value of type func() *string)

Check failure on line 915 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

item.EventId undefined (type matrix_sdk_ffi.EventTimelineItem has no field or method EventId)

Check failure on line 915 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

item.EventId undefined (type matrix_sdk_ffi.EventTimelineItem has no field or method EventId)
}
complementEvent := api.Event{
ID: eventID,
Sender: item.Sender(),
Sender: item.Sender,

Check failure on line 919 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

cannot use item.Sender (value of type func() string) as string value in struct literal

Check failure on line 919 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

cannot use item.Sender (value of type func() string) as string value in struct literal

Check failure on line 919 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

cannot use item.Sender (value of type func() string) as string value in struct literal

Check failure on line 919 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

cannot use item.Sender (value of type func() string) as string value in struct literal
}
switch k := item.Content().Kind().(type) {
case matrix_sdk_ffi.TimelineItemContentKindRoomMembership:
switch k := item.Content.(type) {

Check failure on line 921 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

item.Content (value of type func() *matrix_sdk_ffi.TimelineItemContent) is not an interface

Check failure on line 921 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

item.Content (value of type func() *matrix_sdk_ffi.TimelineItemContent) is not an interface

Check failure on line 921 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

item.Content (value of type func() *matrix_sdk_ffi.TimelineItemContent) is not an interface

Check failure on line 921 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

item.Content (value of type func() *matrix_sdk_ffi.TimelineItemContent) is not an interface
case matrix_sdk_ffi.TimelineItemContentRoomMembership:

Check failure on line 922 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

undefined: matrix_sdk_ffi.TimelineItemContentRoomMembership

Check failure on line 922 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

undefined: matrix_sdk_ffi.TimelineItemContentRoomMembership

Check failure on line 922 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

undefined: matrix_sdk_ffi.TimelineItemContentRoomMembership

Check failure on line 922 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

undefined: matrix_sdk_ffi.TimelineItemContentRoomMembership
complementEvent.Target = k.UserId
change := *k.Change
switch change {
Expand All @@ -949,16 +946,16 @@ func eventTimelineItemToEvent(item *matrix_sdk_ffi.EventTimelineItem) *api.Event
default:
fmt.Printf("%s unhandled membership %d\n", k.UserId, change)
}
case matrix_sdk_ffi.TimelineItemContentKindUnableToDecrypt:
case matrix_sdk_ffi.TimelineItemContentUnableToDecrypt:

Check failure on line 949 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

undefined: matrix_sdk_ffi.TimelineItemContentUnableToDecrypt

Check failure on line 949 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

undefined: matrix_sdk_ffi.TimelineItemContentUnableToDecrypt

Check failure on line 949 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

undefined: matrix_sdk_ffi.TimelineItemContentUnableToDecrypt

Check failure on line 949 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

undefined: matrix_sdk_ffi.TimelineItemContentUnableToDecrypt
complementEvent.FailedToDecrypt = true
}

content := item.Content()
content := item.Content
if content != nil {
msg := content.AsMessage()
if msg != nil {
msgg := *msg
complementEvent.Text = msgg.Body()
switch msg := content.(type) {

Check failure on line 955 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

content (variable of type func() *matrix_sdk_ffi.TimelineItemContent) is not an interface

Check failure on line 955 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

content (variable of type func() *matrix_sdk_ffi.TimelineItemContent) is not an interface

Check failure on line 955 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

content (variable of type func() *matrix_sdk_ffi.TimelineItemContent) is not an interface

Check failure on line 955 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

content (variable of type func() *matrix_sdk_ffi.TimelineItemContent) is not an interface
case matrix_sdk_ffi.TimelineItemContentMessage:

Check failure on line 956 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

undefined: matrix_sdk_ffi.TimelineItemContentMessage

Check failure on line 956 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

undefined: matrix_sdk_ffi.TimelineItemContentMessage

Check failure on line 956 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests (Rust only, latest) / tests

undefined: matrix_sdk_ffi.TimelineItemContentMessage

Check failure on line 956 in internal/api/rust/rust.go

View workflow job for this annotation

GitHub Actions / Tests

undefined: matrix_sdk_ffi.TimelineItemContentMessage

complementEvent.Text = msg.Content.Body
}
}
return &complementEvent
Expand Down

0 comments on commit 7eb4790

Please sign in to comment.