223k views
5 votes
#TODO: This function needs to accept an incoming message and process it accordingly. # This function is called every time the switch receives a new message. #if message.pathThrough == True and message.origin not in self.activeLinks: #self.activeLinks.append(message.origin) #if message.pathThrough == False and message.origin in self.activeLinks: #self.activeLinks.remove(message.origin)

1 Answer

4 votes

Answer:

This function is a method of a class object that checks a message path and register or update the previous messages list with only new messages.

Step-by-step explanation:

def message_check(self ) :

If message.pathThrough == True and \ message.origin not in self.activeLinks:

Self.activeLinks.append( message.origin )

Elif message.pathThrouh == False and \ message.origin in self.activeLinks:

Self.activeLinks.remove( message.origin )

User Toshiyuki
by
4.6k points