@@ -832,6 +832,32 @@ bool Filter_Remap(struct MemMessage *mm,char *namepat,struct Node4DPat *destpat)
832
832
return (TRUE);
833
833
}
834
834
835
+ bool Filter_Masquerade (struct MemMessage * mm ,char * namepat ,struct Node4DPat * destpat )
836
+ {
837
+ char buf [100 ];
838
+ char oldfrom [36 ],newfrom [36 ];
839
+ struct Node4D oldorig4d , neworig4d ;
840
+
841
+ strcpy (oldfrom , mm -> From );
842
+ Copy4D (& oldorig4d ,& mm -> OrigNode );
843
+
844
+ ExpandNodePat (destpat ,& mm -> OrigNode ,& neworig4d );
845
+
846
+ if (strcmp (namepat ,"*" )== 0 ) strcpy (newfrom ,mm -> From );
847
+ else strcpy (newfrom ,namepat );
848
+
849
+ strcpy (mm -> From , newfrom );
850
+ sprintf (buf ,"\x01Masquerade as %s at %u:%u/%u.%u \x0d" ,
851
+ newfrom , neworig4d .Zone , neworig4d .Net , neworig4d .Node , neworig4d .Point );
852
+ mmAddLine (mm ,buf );
853
+
854
+ sprintf (buf ,"\x01Message originally from %s at %u:%u/%u.%ud" ,
855
+ oldfrom , oldorig4d .Zone , oldorig4d .Net , oldorig4d .Node , oldorig4d .Point );
856
+ mmAddLine (mm ,buf );
857
+
858
+ return TRUE;
859
+ }
860
+
835
861
bool Filter (struct MemMessage * mm )
836
862
{
837
863
struct Filter * filter ;
@@ -915,6 +941,11 @@ bool Filter(struct MemMessage *mm)
915
941
return (FALSE);
916
942
917
943
break ;
944
+ case COMMAND_MASQUERADE :
945
+ if (!Filter_Masquerade (mm ,command -> string ,& command -> n4ddestpat ))
946
+ return (FALSE);
947
+
948
+ break ;
918
949
}
919
950
920
951
if (mm -> Flags & MMFLAG_KILL )
0 commit comments