Commits

b3nw  committed a88fdf5

fix everything! or so I hope...

  • Participants
  • Parent commits 5a69308

Comments (0)

Files changed (1)

 	#if we don't have an @wallops, create one
 	if xchat.find_context(channel='@wallops') is None:
 		xchat.command('QUERY @wallops')
-	wallops = xchat.find_context(channel='@wallops')
+	wallops = xchat.find_context(server=xchat.get_info("server"),channel='@wallops')
 	nick = word[0].split("!")
 	wallops.prnt("\00313-%s-\017 %s" % (nick[0].strip(":"), word_eol[4]))
 	return xchat.EAT_ALL
 
 def on_notice(word, word_eol, userdata):
-	#if we don't have an @notices, create one
-	if xchat.find_context(channel='@notices') is None:	
-		xchat.command('QUERY @notices')
-	notice = xchat.find_context(channel='@notices')
 	nick = word[0].strip(":").split("!")
+
 	#print in both the active window and the @notice window unless its a server notice...
 	if(nick[0] != xchat.get_info("server")):
+		if xchat.find_context(server=xchat.get_info("server"), channel='@notices') is None:
+			xchat.command('QUERY @notices')
 		xchat.prnt("\00313-%s-\017 %s" % (nick[0], word_eol[3].strip(":")))
-        notice.prnt("\00313-%s-\017 %s" % (nick[0], word_eol[3].strip(":")))
+		snotice = xchat.find_context(server=xchat.get_info("server"), channel='@notices')
+		snotice.prnt("\00313-%s-\017 %s" % (nick[0], word_eol[3].strip(":")))
+	else:
+		if xchat.find_context(server=xchat.get_info("server"), channel='@snotices') is None:
+			xchat.command('QUERY @snotices')
+		snotice = xchat.find_context(server=xchat.get_info("server"), channel='@snotices')
+	        snotice.prnt("\00313-%s-\017 %s" % (nick[0], word_eol[3].strip(":")))
 	return xchat.EAT_ALL
 
-def on_snotice(word, word_eol, userdata):
-	#if we don't have an @snotice, create one
-        if xchat.find_context(channel='@snotices') is None:
-                xchat.command('QUERY @snotices')
-        notice = xchat.find_context(channel='@snotices')
-        nick = word[0].strip(":").split("!")
-        notice.prnt("\00313-%s-\017 %s" % (nick[0], word_eol[3].strip(":")))
-        return xchat.EAT_ALL
-
-
-
 def on_unload(userdata):
 	print "Unloading Wallops Script...."
 
 xchat.hook_server("WALLOPS", on_wallop)
 xchat.hook_print("Receive Wallops", on_wallop)
 xchat.hook_print("NOTICE", on_notice)
-xchat.hook_server("NOTICE", on_snotice)
+xchat.hook_server("NOTICE", on_notice)
 xchat.hook_unload(on_unload)