Bug - Fixed Clear cached clan data only when actually leave current clan

Veracity

Developer
Staff member
From GenericRequest.run():

Code:
		if ( location.indexOf( "clan" ) != -1 )
		{
			if ( location.indexOf( "action=leaveclan" ) != -1 || location.indexOf( "action=joinclan" ) != -1 )
			{
				ClanManager.clearCache();
			}
		}
The leader of a clan is not allowed to leave. And you can't join the clan you are already in. Each of those has a recognizable failure message.

There may be other similar circumstances, but preemptively clearing the cache because you tried to go to a different clan is wrong. The new & correct KoLmafia technique is to only update internal state when you know that what was attempted succeded.
 

Darzil

Developer
I can only see the message for if you try to join the clan you are in. However, it is probably the case that the results block only appears when joining a clan fails.
 

Veracity

Developer
Staff member
Non-leader leaving:

clan_members.php?action=leaveclan&pwd&confirm=on

It simply redirected to main.php

Joining a clan I am whitelisted to:

showclan.php?pwd&whichclan=xxx&action=joinclan&confirm=on

It simply redirected to clan_hall.php

Leader attempting to leave clan is not given the option on the Membership roster. But if I do it via URL submission:

You're the clan leader. If you want to leave the clan, you have to transfer leadership to somebody else or disband the clan.

Leader attempting to join a different clan:

showclan.php?pwd&whichclan=xxx&action=joinclan&confirm=on

You can't apply to a new clan when you're the leader of an existing clan.
 
Top