Notifications
Clear all

[Solved] Two issues  

(@rained)
Active Member Registered

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?

ReplyQuote
Topic starter Posted : 18/09/2020 5:38 pm
(@skaredcreations)
Honorable Member Admin

Hi Rained,

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

FRANCESCO CROCETTI @ SKARED CREATIONS

ReplyQuote
Posted : 21/09/2020 12:42 pm
(@rained)
Active Member Registered

Thanks!

Were you able to reproduce?

ReplyQuote
Topic starter Posted : 24/09/2020 12:27 am
(@skaredcreations)
Honorable 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.

 
This post was modified 4 months ago by Skared Creations

FRANCESCO CROCETTI @ SKARED CREATIONS

ReplyQuote
Posted : 24/09/2020 6:46 pm
(@rained)
Active Member Registered

Thanks, both fixed!

ReplyQuote
Topic starter Posted : 01/10/2020 7:35 pm
Share: