- long ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ long ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr);
+ Reference.reachabilityFence(msg);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new SendWarningMessage-variant ErrorAction
+ */
+ public static ErrorAction send_warning_message(WarningMessage msg, org.ldk.enums.Level log_level) {
+ long ret = bindings.ErrorAction_send_warning_message(msg == null ? 0 : msg.ptr, log_level);
+ Reference.reachabilityFence(msg);
+ Reference.reachabilityFence(log_level);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };