summary refs log tree commit diff stats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1e8712e..0ed40e2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1371,6 +1371,12 @@ impl<'a, 'ph: 'a> ValidContext<'a, 'ph> {
             ph_call!(hexchat_send_modes(ph, arr.as_mut_ptr(), arr.len() as c_int,
                 mpl as c_int, sign as c_char, mode as c_char));
         }
+        // some hexchat forks may invalidate the context here.
+        // just pretend everything is fine and don't bump the major version.
+        if !self.set_context(&self.get_context()) {
+            let context = self.ph.find_valid_context().unwrap();
+            if !self.set_context(&context) { panic!(); }
+        }
     }
 
     /// Returns a client setting.