When a message is sent to Geochat, the group of the message has to be determined. The following rules are applied:
If the message came through a global gateway:
If the message text begins with the alias of a group, and the sender belongs to that group, then that group is used (same rule applies for a blast in which the group should be the first word after the #b command). If the user does not belong to that group, the message fails.
Else, if the first word of the message could not be matched with the alias of a valid group, the sender's default group is used.
Else, if the sender has no default group, or it is disabled, the group to which the user sent his last message is used.
Else, if the sender has sent no messages before, the group which he joined the last is used.
Otherwise, the message is not delivered, a reply explaining the problem is sent to the sender.
If the gateway is a local gateway:
If the message text begins with the alias of a group the sender belongs to, and that group has permission over the gateway, then that group is used (same rule applies for a blast in which the group should be the first word after the #b command). If the user does not belong to that group, or the group cannot use the gateway, fails.
Else, if the first word of the message could not be matched with the alias of a valid group, and the user has membership in only one group among those that have access to the gateway, that single group is chosen.
Else, if the sender's default group has access to the gateway, it is used.
Else, the group to which the user sent his last message, selected over the groups that have access to the gateway, is used.
Else, the group which he joined the last is used, selected over the groups that have access to the gateway, is used.
Otherwise, the message is not delivered, a reply explaining the problem is sent to the sender.
In the case of direct messages, the same rules apply, but the list of possible groups considered is narrowed to group in which both the sender and the recipient are members.