Notifications
Clear all

[Solved] Two issues

5 Posts
2 Users
0 Reactions
449 Views
(@rained)
Posts: 5
Active Member
Topic starter
 

Hello! We are having two issues:

 

1) With Mail.SendMailToGroup:

When the sender is the UserGroup owner, everyone gets the message, but when the sender is a member, the owner does not get the message.

Is that intended? Where should we look at?

 

2) When adding contacts with User.AddContact

We have an input field in which  players can type the username of the player they want add.

But in the case of numeric usernames (like 1418), the invite goes to user with that id, not with that username.

We use the AddContact(string, ...) method and I checked User.cs that form.AddField("Username") is filled and form.AddField("Id") is ignored.

Is there a way to handle that?

 
Posted : 18/09/2020 4:38 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Hi Rained,

I'll check your issue report and get back with a fix.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 21/09/2020 11:42 am
(@rained)
Posts: 5
Active Member
Topic starter
 

Thanks!

Were you able to reproduce?

 
Posted : 23/09/2020 11:27 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Edit /mail.php:

  • replace line 131 with the following:
$user = $isId ? newAccount($id) : Account::LoadByUsername($id);
  • replace the else if statement at lines 156-168 with the following:
} else if (isset($WS_REQUEST["IdGroup"])) {
    $groupId = intval($WS_REQUEST["IdGroup"]);
    $group = new UserGroup($groupId);
    if ($group->Id > 0) {
        // Get the recipients from the group
        $members = $group->GetMembersAccount();
        $addOwner = TRUE;
        foreach ($members as $user) {
            $recipients[] = $user;
            if ($user->Id == $group->IdOwner) {
                $addOwner = FALSE;
            }
        }
        if ($group->IdOwner > 0 && $addOwner) {
            $recipients[] = new Account($group->IdOwner);
        }
    } else {
        $groupId = 0;
    }
}

 

Edit /contacts.php:

  • replace line 84 with the following:
$user = Account::LoadByUsername($username);

 

These changes will be also included in the next update.

 

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 24/09/2020 5:46 pm
(@rained)
Posts: 5
Active Member
Topic starter
 

Thanks, both fixed!

 
Posted : 01/10/2020 6:35 pm
Share: