Image copyright Getty Images

The London Bridge attacks set Donald Trump off on an extended Twitter rant over the past few days, reviving his calls for sweeping immigration action and renewing old feuds with Democrats, gun-control advocates and even the mayor of London.

While White House advisor Kellyanne Conway recently complained that the media have an "obsession with covering everything he says on Twitter and very little of what he does as president", Mr Trump is the pot-stirrer-in-chief, who has the power to drive debate and shape events.

Words, whether spoken or tweeted, have consequences. The president's Monday morning fusillade about his immigration policy is no exception. Here are five things we learned.

A ban is a ban is a ban

The lynchpin of the White House's defence of Mr Trump's two controversial immigration executive orders that set restrictions on immigration from a handful of majority-Muslim nations was that they had no connection to the anti-Muslim travel ban candidate Trump proposed back in December 2015.

The executive actions, they argued, constituted temporary restrictions and not a "ban", Muslim or otherwise.

The president has occasionally undercut that defence, by using the b-word in the past - leaving his aides to clean up the mess.

Media playback is unsupported on your device Media caption Sean Spicer on the Muslim ban

"It's not a Muslim ban. It's not a travel ban," Press Secretary Sean Spicer said back in January. "It's a vetting system to keep America safe."

On Monday morning, however, Mr Trump applied kerosene to that defence, set it ablaze and danced around its ashes.

"People, the lawyers and the courts can call it whatever they want," he tweeted, "but I am calling it what we need and what it is, a TRAVEL BAN."

Image copyright Getty Images Image caption The fate of Mr Trump's travel ban likely will rest with the US Supreme Court

Trump targets the courts (again)

Speaking of the judicial branch, the president on Monday morning went on the attack against the US legal system, calling the courts "slow and political".

The line is reminiscent of one of the president's more inflammatory tweets, when he lashed out against the federal judge who struck down his original immigration order.

"The opinion of this so-called judge, which essentially takes law-enforcement away from our country, is ridiculous and will be overturned!" he tweeted on 4 February.

The following day he issued an even more ominous warning, tweeting that the judge put the nation in peril and "if something bad happens blame him and the court system".

According to one theory, advanced by Lawfare blog's Jack Goldsmith, Mr Trump's seemingly ill-considered comments are all part of a plan to get the courts to strike down his immigration orders, freeing him to blame the judiciary for any subsequent attacks.

It may, however, be just another case of "what you see is what you get" with Mr Trump. He has feuded with judges throughout his professional life, including criticising the Mexican heritage of the man who was presiding over a lawsuit against his for-profit "university" during last year's presidential campaign.

President Trump is the same as candidate Trump is the same as businessman/TV star Trump. The stage may be different, but the man doesn't change.

Image copyright Getty Images Image caption Donald Trump has taken a shot at the Justice Department, run by Jeff Sessions (right)

Trump turns on his own

One of the more unusual components of Mr Trump's Monday morning diatribe was that he turned his Twitter invective on his own administration.

He lashed out at the Justice Department, headed by his close political confidant Jeff Sessions, for focusing its legal defence on what he called the "watered down, politically correct" second executive order on immigration and not the more sweeping first version that explicitly mentioned religion and caused confusion when it was first enforced at airport immigration checkpoints.

Justice Department lawyers have tried to decouple the second order from the original, arguing that it remedied the discriminatory portions of the earlier effort, clarified that those with legal residency were unaffected and focused exclusively on nations that had previously been determined to be of concern to US.

When the president signed that second order in early March, Spicer tweeted that it would "keep the nation safe".

"This revised order will bolster the security of the United States and our allies" Secretary of State Rex Tillerson said.

Now the president is bad-mouthing the very same action his aides had resolutely defended. He is clearly irked that his administration abandoned that first travel order, particularly after he told its critics that he would see them "in court".

If Mr Trump continues to casually undercut his own people, however, they'll be less willing to rush to his defence in the coming days - when the president may need them most.

Last week, for instance, multiple officials doggedly refused to say whether the president believes climate change is caused by human activity - a position most conservative officeholders, including the president's own Environmental Protection Agency head, accept. Such reluctance may be just a taste of things to come.

Why go out on a limb for a president who is standing by the tree with a saw in hand?

Image copyright Getty Images Image caption Details on the Trump administration's "extreme vetting" policies have been scarce

Extreme vetting is back

The president also dusted off one of his favourite terms from the 2016 campaign - "extreme vetting" - which he said is helping "keep our country safe".

The original justification for the travel ban orders was that they were a temporary measure to allow a rigorous review process to be instituted for all individuals entering the US. The first action's time frame for implementation was 90 days - which would have set the mark at 27 April.

The second order, signed on 6 March, reset the 90-day clock again - a point that was reached on Sunday.

The Weekly Standard's Michael Warren reached out to the Trump White House for further clarification on what vetting measures had been put in place and was directed to the State Department, which has not yet responded.

Before Monday morning the last time the president himself had mentioned "extreme vetting" was in mid-February, when he said it "will be put in place, and it already is in place in many places".

Now extreme vetting - as a term at least - is back. But what is it? And if it's already in place, doesn't that erase the justification for implementing the travel ban?

It might - unless, of course, the ban was never intended to be temporary. That's a question the "slow and political" courts are likely to consider.

Image copyright Getty Images Image caption James Comey's Senate testimony looms on the horizon

Trump is cornered

The president's social media onslaught comes after the latest round of stories about how the president was going to be more disciplined and focused, and less prone to Twitter tirades. Mr Trump's lawyers, we were told, were counselling him to tamp things down, lest his comments land him in more hot water.

The president has apparently disregarded this advice yet again and is trying his best to fight old battles and rekindle old feuds.

Why? Perhaps it's because there is a very dark storm cloud on the horizon. On Thursday former FBI Director James Comey - the man Mr Trump dramatically fired and has since very publicly insulted - will testify under oath before a Senate inquiry into Russia's meddling in the US presidential election. He's expected to discuss reports that the president asked him to pledge his loyalty and pressured him to back off from his investigation of Trump foreign policy advisor Michael Flynn.

Given Mr Comey's reputation for political independence and moral certitude - combined with the possibility that he has contemporaneous memos documenting his interactions with the president - the testimony could be disastrous for the White House.

At the very least, it will be a spectacle the likes of which Washington has not seen in decades.

The president could be eager to change the subject or, at the very least, deflect some attention. If so, the past few days of Twitter invective could be just the start.