[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / CustomOnionMessageHandler.cs
index d3b989ff326e827a169a6f8c73a837e621056324..86e23eec402d88e32ba72bd7b80e83e807a94879 100644 (file)
@@ -30,9 +30,9 @@ public class CustomOnionMessageHandler : CommonBase {
 
        public interface CustomOnionMessageHandlerInterface {
                /**
-                * Called with the custom message that was received.
+                * Called with the custom message that was received, returning a response to send, if any.
                 */
-               void handle_custom_message(CustomOnionMessageContents _msg);
+               Option_CustomOnionMessageContentsZ handle_custom_message(CustomOnionMessageContents _msg);
                /**
                 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
                 * message type is unknown.
@@ -44,11 +44,14 @@ public class CustomOnionMessageHandler : CommonBase {
                internal LDKCustomOnionMessageHandlerImpl(CustomOnionMessageHandlerInterface arg, LDKCustomOnionMessageHandlerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; }
                private CustomOnionMessageHandlerInterface arg;
                private LDKCustomOnionMessageHandlerHolder impl_holder;
-               public void handle_custom_message(long _msg) {
+               public long handle_custom_message(long _msg) {
                        CustomOnionMessageContents ret_hu_conv = new CustomOnionMessageContents(null, _msg);
                        if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
-                       arg.handle_custom_message(ret_hu_conv);
+                       Option_CustomOnionMessageContentsZ ret = arg.handle_custom_message(ret_hu_conv);
                                GC.KeepAlive(arg);
+                       long result = ret == null ? 0 : ret.clone_ptr();
+                       if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); };
+                       return result;
                }
                public long read_custom_message(long _message_type, byte[] _buffer) {
                        Result_COption_CustomOnionMessageContentsZDecodeErrorZ ret = arg.read_custom_message(_message_type, _buffer);
@@ -63,13 +66,17 @@ public class CustomOnionMessageHandler : CommonBase {
                return impl_holder.held;
        }
        /**
-        * Called with the custom message that was received.
+        * Called with the custom message that was received, returning a response to send, if any.
         */
-       public void handle_custom_message(org.ldk.structs.CustomOnionMessageContents msg) {
-               bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr);
+       public Option_CustomOnionMessageContentsZ handle_custom_message(org.ldk.structs.CustomOnionMessageContents msg) {
+               long ret = bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Option_CustomOnionMessageContentsZ ret_hu_conv = org.ldk.structs.Option_CustomOnionMessageContentsZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
                if (this != null) { this.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
        }
 
        /**