Coder Social home page Coder Social logo

Comments (7)

GalacticWave avatar GalacticWave commented on May 24, 2024

I have isolated the issue to be on this file - /nextcloud/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php around line 217:

// Try to get the sender name from the current user id if available.
if ($this->userId !== null && ($senderName === null || empty(trim($senderName)))) {
$senderName = $this->userManager->getDisplayName($this->userId);
}

When the event is created on Thunderbird, there is no userID set and that's why the sender name defaults to the default "Nextcloud". I propose to rewrite this secton this way:

$sender = substr($iTipMessage->sender, 7);

// Try to get the sender name from the current user id or from sender if available.
if ($senderName === null || empty(trim($senderName))) {
if ($this->userId !== null){
$senderName = $this->userManager->getDisplayName($this->userId);
} else {
$senderName = $this->userManager->getDisplayName($sender);
}
}

Basically use the Sender from the iTipMessage object when userID is also null.

from server.

kesselb avatar kesselb commented on May 24, 2024

cc @ChristophWurst @miaulalala @SebastianKrupinski

from server.

SebastianKrupinski avatar SebastianKrupinski commented on May 24, 2024

Issue confirmed.

@GalacticWave your solution will not work. userManager->getDisplayName() requires a NC UID and $iTipMessage->sender() at this point is a email address.

from server.

SebastianKrupinski avatar SebastianKrupinski commented on May 24, 2024

Diagnosed.

This an upstream issue caused by a fresh session with no cookie information. Causes userId to be null.

from server.

GalacticWave avatar GalacticWave commented on May 24, 2024

I found that email address is the userID used in the Database. Hence, I simply used the sender which is also email address. Mabye because on my server, I used the email address as the username as well for all the accounts created. But seems like there is more to this that I didn't consider.

The thing I can think of now is whether its possible to get the First and Last name from the user DB by querying using email address. But didn't find any existing functions or user cache functions that can do that.

from server.

SebastianKrupinski avatar SebastianKrupinski commented on May 24, 2024

Querying the database for email address will not work, as email address are NOT unique. You can have multiple users with the same email address, but userId are unique.

from server.

st3iny avatar st3iny commented on May 24, 2024

Something isn't right with the authentication. The property $userId is injected via our DI. It seems to be null but this shouldn't be the case if the request is authenticated (which it is via the user and (app) password that Thunderbird is using).

from server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.