@yuneta/gobj-js 7.13.2 → 7.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1583,7 +1583,7 @@
1583
1583
  let ret = 0;
1584
1584
  if (gobj.gclass.gmt.mt_play) {
1585
1585
  ret = gobj.gclass.gmt.mt_play(gobj);
1586
- if (ret < 0) gobj.playing = false;
1586
+ if (ret < 0 || ret === false) gobj.playing = false;
1587
1587
  }
1588
1588
  return ret;
1589
1589
  }
@@ -2717,7 +2717,8 @@
2717
2717
  if (kw) trace_json(kw);
2718
2718
  }
2719
2719
  if (publisher.gclass.gmt.mt_subscription_added) {
2720
- if (publisher.gclass.gmt.mt_subscription_added(publisher, subs) < 0) {
2720
+ let result = publisher.gclass.gmt.mt_subscription_added(publisher, subs);
2721
+ if (result < 0 || result === false) {
2721
2722
  _delete_subscription(publisher, subs, true, true);
2722
2723
  subs = 0;
2723
2724
  }
@@ -2866,7 +2867,7 @@
2866
2867
  if (publisher.gclass.gmt.mt_publication_pre_filter) {
2867
2868
  let topublish = publisher.gclass.gmt.mt_publication_pre_filter(publisher, subs, event, kw);
2868
2869
  if (topublish < 0) break;
2869
- else if (topublish === 0) continue;
2870
+ else if (!topublish) continue;
2870
2871
  }
2871
2872
  let subscriber = kw_get_pointer(publisher, subs, "subscriber", null, kw_flag_t.KW_REQUIRED);
2872
2873
  if (!(subscriber && !gobj_is_destroying(subscriber))) continue;
@@ -2881,14 +2882,14 @@
2881
2882
  let topublish = 1;
2882
2883
  if (publisher.gclass.gmt.mt_publication_filter) topublish = publisher.gclass.gmt.mt_publication_filter(publisher, event, kw2publish, subscriber);
2883
2884
  else if (json_size(__filter__) > 0) {
2884
- topublish = kw_match_simple(kw2publish, __filter__);
2885
+ topublish = kw_match_simple(kw2publish, __filter__) ? 1 : 0;
2885
2886
  if (tracea) {
2886
2887
  trace_machine(sprintf("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", topublish ? "👍" : "👎", event ? event : "", gobj_short_name(subscriber), gobj_short_name(publisher)));
2887
2888
  trace_json(__filter__);
2888
2889
  }
2889
2890
  }
2890
2891
  if (topublish < 0) break;
2891
- else if (topublish === 0) continue;
2892
+ else if (!topublish) continue;
2892
2893
  let ev_ = gobj_event_type(subscriber, event, true);
2893
2894
  if (ev_) {
2894
2895
  if (ev_.event_flag & event_flag_t.EVF_SYSTEM_EVENT) {