Skip to content
7 changes: 6 additions & 1 deletion Lagrange.Core.NativeAPI/OperateGroupEntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static IntPtr GetMemberList(int index, long groupUin, bool refresh /*= fa
{
Marshal.StructureToPtr(
(BotGroupMemberStruct)members[i],
result.Events + i * Marshal.SizeOf<BotGroupStruct>(),
result.Events + i * Marshal.SizeOf<BotGroupMemberStruct>(),
false
);
}
Expand Down Expand Up @@ -246,13 +246,15 @@ private static IntPtr GetGroupNotificationsStructPtr(List<BotGroupNotificationBa
false
);
break;

case BotGroupNotificationType.SetAdmin:
Marshal.StructureToPtr(
(BotGroupSetAdminNotificationStruct)(BotGroupSetAdminNotification)notifications[i],
result.Events + i * Marshal.SizeOf<BotGroupSetAdminNotificationStruct>(),
false
);
break;

case BotGroupNotificationType.KickOther:
case BotGroupNotificationType.KickSelf:
Marshal.StructureToPtr(
Expand All @@ -261,20 +263,23 @@ private static IntPtr GetGroupNotificationsStructPtr(List<BotGroupNotificationBa
false
);
break;

case BotGroupNotificationType.Exit:
Marshal.StructureToPtr(
(BotGroupExitNotificationStruct)(BotGroupExitNotification)notifications[i],
result.Events + i * Marshal.SizeOf<BotGroupExitNotificationStruct>(),
false
);
break;

case BotGroupNotificationType.UnsetAdmin:
Marshal.StructureToPtr(
(BotGroupUnsetAdminNotificationStruct)(BotGroupUnsetAdminNotification)notifications[i],
result.Events + i * Marshal.SizeOf<BotGroupUnsetAdminNotificationStruct>(),
false
);
break;

case BotGroupNotificationType.Invite:
Marshal.StructureToPtr(
(BotGroupInviteNotificationStruct)(BotGroupInviteNotification)notifications[i],
Expand Down