def _cmd_enc(arg1=None, arg2=None, arg3=None, arg4=None, arg5=None): global chat_msg_hook global room_msg_hook if arg1 == "end": prof.encryption_reset(arg2) elif arg1 == "chat_title" and arg2 == "set": prof.chat_set_titlebar_enctext(arg3, arg4) elif arg1 == "chat_title" and arg2 == "reset": prof.chat_unset_titlebar_enctext(arg3) elif arg1 == "chat_ch" and arg2 == "set" and arg3 == "in": prof.chat_set_incoming_char(arg4, arg5) elif arg1 == "chat_ch" and arg2 == "reset" and arg3 == "in": prof.chat_unset_incoming_char(arg4) elif arg1 == "chat_ch" and arg2 == "set" and arg3 == "out": prof.chat_set_outgoing_char(arg4, arg5) elif arg1 == "chat_ch" and arg2 == "reset" and arg3 == "out": prof.chat_unset_outgoing_char(arg4) elif arg1 == "room_title" and arg2 == "set": prof.room_set_titlebar_enctext(arg3, arg4) elif arg1 == "room_title" and arg2 == "reset": prof.room_unset_titlebar_enctext(arg3) elif arg1 == "room_ch" and arg2 == "set": prof.room_set_message_char(arg3, arg4) elif arg1 == "room_ch" and arg2 == "reset": prof.room_unset_message_char(arg3) elif arg1 == "chat_show": prof.chat_show(arg2, arg3) elif arg1 == "chat_show_themed": prof.chat_show_themed(arg2, "enc_py", "chat_msg", None, "p", arg3) elif arg1 == "room_show": prof.room_show(arg2, arg3) elif arg1 == "room_show_themed": prof.room_show_themed(arg2, "enc_py", "room_msg", None, "P", arg3) elif arg1 == "chat_msg": chat_msg_hook = arg2 elif arg1 == "room_msg": room_msg_hook = arg2 else: prof.cons_bad_cmd_usage("/enc_py")
def show_chat_critical(barejid, message): prof.chat_show_themed( barejid, PLUGIN_NAME, 'critical', 'bold_red', None, message )
def prof_pre_chat_message_send(barejid, message): if chat_msg_hook == "modify": return "[py modified] " + message elif chat_msg_hook == "block": prof.chat_show_themed(barejid, None, None, "bold_red", "!", "Python plugin blocked message") return None else: prof.log_info("none") return message
def show_chat_warning(barejid, message): prof.chat_show_themed( barejid, PLUGIN_NAME, 'warning', 'bold_yellow', None, message )
def show_chat_info(barejid, message): prof.chat_show_themed( barejid, PLUGIN_NAME, 'info', 'cyan', None, message )